Skip to content

Commit

Permalink
6.9.4 (#2887)
Browse files Browse the repository at this point in the history
* fixes #2884

* fixes #2886

* fixes #2881

* fixes #2879

* fixes #2857

* #2793

* #2793
v6.9.4
  • Loading branch information
Eonasdan authored Dec 21, 2023
1 parent 8a371d2 commit 5f79399
Show file tree
Hide file tree
Showing 23 changed files with 173 additions and 82 deletions.
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ labels: ["Type: Bug", "State: Triage"]
body:
- type: markdown
attributes:
value: "Note: I am no longer taking feature requests.
Beginning in 2024, tickets will be paid support only. Please see [this discussion](https://github.com/Eonasdan/tempus-dominus/discussions/2694)."
value: "<h3>Note: I am no longer taking feature requests.
Beginning in 2024, tickets will be paid support only. Please see [this discussion](https://github.com/Eonasdan/tempus-dominus/discussions/2694).</h3>"
- type: checkboxes
attributes:
label: Prerequisites
Expand All @@ -18,6 +18,8 @@ body:
required: true
- label: I have read the [contributing guidelines](https://github.com/Eonasdan/tempus-dominus/blob/master/.github/CONTRIBUTING.md).
required: true
- label: I understand that only sponsored issues will be worked on and that if I wish to sponsor an issue, I will contact the owner FIRST.
required: true
- type: textarea
id: what-happened
attributes:
Expand All @@ -32,7 +34,7 @@ body:
id: reduced-test-case
attributes:
label: StackBlitz fork
description: "You MUST provide an StackBlitz fork of one of the following examples: [HTML](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup), [Dev branch](https://stackblitz.com/edit/tempus-dominus-v6-next), [Typescript](https://stackblitz.com/edit/v6-typescript), [Using import](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup-import), or [jQuery](https://stackblitz.com/edit/tempus-dominus-v6-simple-jquery-setup)."
description: "You MUST provide an StackBlitz fork of one of the following examples: [HTML](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup), [Typescript](https://stackblitz.com/edit/v6-typescript), [Using import](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup-import), or [jQuery](https://stackblitz.com/edit/tempus-dominus-v6-simple-jquery-setup)."
validations:
required: true
- type: dropdown
Expand Down
2 changes: 0 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
PRs relating to the v4 will be closed and locked.

* **Please check if the PR fulfills these requirements**
- [ ] The PR is against the `development` branch
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ] Does NOT modify files under the "dist" folder.


* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...). If this is a fix, please tag a bug.
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R53OEFF)

# Tempus Dominus Date/Time Picker v6.7.19
# Paid support only

Please note that I'm moving on to other projects. New issues will need to be sponsored. This can be done via BountySource or my other donation links. Please reach out to me first so we can discuss the terms. Thank you for your years of support.

# Tempus Dominus Date/Time Picker v6.9.4

Tempus Dominus is a powerful and robust date time picker for javascript. Version 6 is another major rewrite over the previous version. V6 is written with modern browsers in mind and is written in typescript. Bootstrap, momentjs and jQuery are no longer required dependencies. Popper2 is all that is required for the picker to position correctly. If you still require jQuery (seriously, you should move off that asap) there's a jQuery provider that wraps the native js functions.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Jonathan Peterson"
},
"name": "@eonasdan/tempus-dominus",
"version": "6.7.19",
"version": "6.9.4",
"style": "dist/css/tempus-dominus.css",
"sass": "scss/tempus-dominus.scss",
"main": "dist/js/tempus-dominus.js",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sonar.organization=eonasdan
sonar.projectKey=Eonasdan_tempus-dominus

sonar.projectName=tempus-dominus
sonar.projectVersion=6.7.19
sonar.projectVersion=6.9.4

sonar.sources = src/
sonar.tests = test/
17 changes: 17 additions & 0 deletions src/docs/partials/change-log.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<div id='change-log'>
<h1>Version 6</h1>

<div class='row'>
<h2>6.9.4</h2>
<h3>New</h3>
<ul>
<li>SCSS now provides <code>root</code> css variables #2857</li>
<li>Custom date format parsing errors are now caught and provided through the event system. #2793</li>
</ul>
<h3>Bug fixes</h3>
<ul>
<li>Fixed #2886</li>
<li>Fixed #2884</li>
<li>Fixed #2881</li>
<li>Fixed #2879</li>
<li>Fixed #2877 </li>
</ul>
</div>

<div class='row'>
<h2>6.7.19</h2>
<h3>New</h3>
Expand Down
4 changes: 2 additions & 2 deletions src/docs/partials/installing.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ <h2 id='cdn'>Via CDN</h2>
<code class='language-html'>&lt;!-- Popperjs --&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;!-- Tempus Dominus JavaScript --&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.19/dist/js/tempus-dominus.min.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.9.4/dist/js/tempus-dominus.min.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;

&lt;!-- Tempus Dominus Styles --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.19/dist/css/tempus-dominus.min.css&quot; crossorigin=&quot;anonymous&quot;&gt;</code>
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.9.4/dist/css/tempus-dominus.min.css&quot; crossorigin=&quot;anonymous&quot;&gt;</code>
</pre>
</div>

Expand Down
6 changes: 3 additions & 3 deletions src/docs/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1 class='mb-3 fw-semibold'>Powerful and robust date and time picker</h1>
</div>
</div>
<p class='text-muted mb-0'>
Currently <strong>v6.7.19</strong>
Currently <strong>v6.9.4</strong>
<span class='px-1'>&middot;</span>
<a href='https://getdatepicker.com/5-4/' class='link-secondary'>v5 docs</a>
</p>
Expand Down Expand Up @@ -55,10 +55,10 @@ <h3 class='fw-semibold'>JsDelivr</h3>
<code class='language-html'>&lt;!-- Popperjs --&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js&quot; integrity=&quot;sha256-BRqBN7dYgABqtY9Hd4ynE+1slnEw+roEPFzQ7TRRfcg=&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;!-- Tempus Dominus JavaScript --&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.19/dist/js/tempus-dominus.min.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.9.4/dist/js/tempus-dominus.min.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;

&lt;!-- Tempus Dominus Styles --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.19/dist/css/tempus-dominus.min.css&quot; crossorigin=&quot;anonymous&quot;&gt;</code>
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.9.4/dist/css/tempus-dominus.min.css&quot; crossorigin=&quot;anonymous&quot;&gt;</code>
</pre>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/docs/templates/shell.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<span class='d-none d-lg-inline'>Tempus Dominus</span> v6.0
</button>
<ul class='dropdown-menu dropdown-menu-end' aria-labelledby='bd-versions'>
<li><a class='dropdown-item current' aria-current='true' href='/6/'>Latest (6.7.19)</a></li>
<li><a class='dropdown-item current' aria-current='true' href='/6/'>Latest (6.9.4)</a></li>
<li>
<hr class='dropdown-divider'>
</li>
Expand Down Expand Up @@ -181,7 +181,7 @@
target='_blank' rel='license noopener'>MIT</a>, docs <a
href='https://creativecommons.org/licenses/by/3.0/' target='_blank' rel='license noopener'>CC BY 3.0</a>.
</li>
<li class='mb-2'>Currently v6.7.19</li>
<li class='mb-2'>Currently v6.9.4</li>
</ul>
</div>
<div class='col-6 col-lg-2 offset-lg-1 mb-3'>
Expand Down
26 changes: 20 additions & 6 deletions src/js/dates.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { DateTime, getFormatByUnit, Unit } from './datetime';
import Namespace from './utilities/namespace';
import { ChangeEvent, FailEvent } from './utilities/event-types';
import {
ChangeEvent,
FailEvent,
ParseErrorEvent,
} from './utilities/event-types';
import Validation from './validation';
import { serviceLocator } from './utilities/service-locator';
import { EventEmitters } from './utilities/event-emitter';
Expand Down Expand Up @@ -57,11 +61,21 @@ export default class Dates {
*/
//eslint-disable-next-line @typescript-eslint/no-explicit-any
parseInput(value: any): DateTime {
return OptionConverter.dateConversion(
value,
'input',
this.optionsStore.options.localization
);
try {
return OptionConverter.dateConversion(
value,
'input',
this.optionsStore.options.localization
);
} catch (e) {
this._eventEmitters.triggerEvent.emit({
type: Namespace.events.error,
reason: Namespace.errorMessages.failedToParseInput,
format: this.optionsStore.options.localization.format,
value: value,
} as ParseErrorEvent);
return undefined;
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/js/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ export class DateTime extends Date {
/(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR

private formattingTokens =
/(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is
/(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?d?d?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is

/**
* Returns a list of month values based on the current locale
Expand Down
4 changes: 3 additions & 1 deletion src/js/display/calendar/date-display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ export default class DateDisplay {
private _dateToDataValue(date: DateTime): string {
if (!DateTime.isValid(date)) return '';

return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`;
return `${date.year}-${date.month.toString().padStart(2, '0')}-${date.date
.toString()
.padStart(2, '0')}`;
}

private _handleDateRange(innerDate: DateTime, classes: string[]) {
Expand Down
9 changes: 9 additions & 0 deletions src/js/display/calendar/decade-display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ export default class DecadeDisplay {
) {
classes.push(Namespace.css.active);
}
if (
!this.validation.isValid(this._startDecade, Unit.year) &&
!this.validation.isValid(
this._startDecade.clone.manipulate(10, Unit.year),
Unit.year
)
) {
classes.push(Namespace.css.disabled);
}

paint('decade', this._startDecade, classes, containerClone);

Expand Down
2 changes: 1 addition & 1 deletion src/js/jQuery-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*global $, tempusDominus */

/*!
* Tempus Dominus v6.7.19 (https://getdatepicker.com/)
* Tempus Dominus v6.9.4 (https://getdatepicker.com/)
* Copyright 2013-2021 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion src/js/tempus-dominus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ const extend = function (plugin, option = undefined) {
return tempusDominus;
};

const version = '6.7.19';
const version = '6.9.4';

const tempusDominus = {
TempusDominus,
Expand Down
15 changes: 14 additions & 1 deletion src/js/utilities/event-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ interface BaseEvent {
viewMode?: keyof ViewMode;
}

interface ParseErrorEvent extends BaseEvent {
reason: string;
value: unknown;
format: string;
}

/**
* Triggers when setValue fails because of validation rules etc.
* @event FailEvent
Expand Down Expand Up @@ -40,4 +46,11 @@ interface ViewUpdateEvent extends BaseEvent {
viewDate: DateTime;
}

export { BaseEvent, FailEvent, HideEvent, ChangeEvent, ViewUpdateEvent };
export {
BaseEvent,
FailEvent,
HideEvent,
ChangeEvent,
ViewUpdateEvent,
ParseErrorEvent,
};
9 changes: 2 additions & 7 deletions src/js/utilities/optionConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,7 @@ export class OptionConverter {
if (eData?.tdTargetInput) delete eData.tdTargetInput;
if (eData?.tdTargetToggle) delete eData.tdTargetToggle;

if (
!eData ||
Object.keys(eData).length === 0 ||
eData.constructor !== DOMStringMap
)
return options;
if (!eData || Object.keys(eData).length === 0) return options;
const dataOptions = {} as Options;

// because dataset returns camelCase including the 'td' key the option
Expand Down Expand Up @@ -253,7 +248,7 @@ export class OptionConverter {
if (keyOption === undefined) return internalObject;

// if this is another object, continue down the rabbit hole
if (optionSubgroup[keyOption].constructor === Object) {
if (optionSubgroup[keyOption]?.constructor === Object) {
index++;
internalObject[keyOption] = normalizeObject(
split,
Expand Down
2 changes: 1 addition & 1 deletion src/js/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default class Validation {
return true;
}

private _enabledDisabledHoursIsValid(targetDate) {
private _enabledDisabledHoursIsValid(targetDate: DateTime) {
if (
this.optionsStore.options.restrictions.disabledHours.length > 0 &&
this._isInDisabledHours(targetDate)
Expand Down
2 changes: 1 addition & 1 deletion src/nuget/TempusDominus.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>TempusDominus</id>
<version>6.7.19</version>
<version>6.9.4</version>
<title>Tempus Dominus</title>
<authors>Eonasdan</authors>
<owners>Eonasdan</owners>
Expand Down
2 changes: 1 addition & 1 deletion src/nuget/TempusDominus.scss.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>TempusDominus.scss</id>
<version>6.7.19</version>
<version>6.9.4</version>
<title>Tempus Dominus</title>
<authors>Eonasdan</authors>
<owners>Eonasdan</owners>
Expand Down
36 changes: 36 additions & 0 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,39 @@ $td-dark-secondary-border-color-rgba: rgba(232, 230, 227, 0.2) !default;
$td-dark-primary-border-color: $td-dark !default;
$td-dark-text-shadow: 0 -1px 0 rgba(232, 230, 227, 0.25) !default;
$td-dark-dow-color: rgba(232, 230, 227, 0.5);

:root {
--td-light: #{$td-light};
--td-widget-background: #{$td-widget-background};
--td-font-color: #{$td-font-color};
--td-timepicker-font-size: #{$td-timepicker-font-size};
--td-active-bg: #{$td-active-bg};
--td-range-bg: #{$td-range-bg};
--td-active-color: #{$td-active-color};
--td-active-border-color: #{$td-active-border-color};
--td-border-radius: #{$td-border-radius};
--td-btn-hover-bg: #{$td-btn-hover-bg};
--td-disabled-color: #{$td-disabled-color};
--td-alternate-color: #{$td-alternate-color};
--td-secondary-border-color: #{$td-secondary-border-color};
--td-secondary-border-color-rgba: #{$td-secondary-border-color-rgba};
--td-primary-border-color: #{$td-primary-border-color};
--td-text-shadow: #{$td-text-shadow};
--td-dow-color: #{$td-dow-color};

--td-dark: #{$td-dark};
--td-dark-widget-background: #{$td-dark-widget-background};
--td-dark-font-color: #{$td-dark-font-color};
--td-dark-active-bg: #{$td-dark-active-bg};
--td-dark-range-bg: #{$td-dark-range-bg};
--td-dark-active-color: #{$td-dark-active-color};
--td-dark-active-border-color: #{$td-dark-active-border-color};
--td-dark-btn-hover-bg: #{$td-dark-btn-hover-bg};
--td-dark-disabled-color: #{$td-dark-disabled-color};
--td-dark-alternate-color: #{$td-dark-alternate-color};
--td-dark-secondary-border-color: #{$td-dark-secondary-border-color};
--td-dark-secondary-border-color-rgba: #{$td-dark-secondary-border-color-rgba};
--td-dark-primary-border-color: #{$td-dark-primary-border-color};
--td-dark-text-shadow: #{$td-dark-text-shadow};
--td-dark-dow-color: #{$td-dark-dow-color};
}
Loading

0 comments on commit 5f79399

Please sign in to comment.