@syncfusion/ej2-calendars 26.2.12 → 27.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/dist/ej2-calendars.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js.map +1 -1
- package/dist/es6/ej2-calendars.es2015.js +224 -73
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +224 -73
- package/dist/es6/ej2-calendars.es5.js.map +1 -1
- package/dist/global/ej2-calendars.min.js +2 -2
- package/dist/global/ej2-calendars.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/calendar/calendar.js +31 -19
- package/src/datepicker/datepicker.d.ts +2 -0
- package/src/datepicker/datepicker.js +38 -15
- package/src/daterangepicker/daterangepicker.d.ts +1 -0
- package/src/daterangepicker/daterangepicker.js +27 -13
- package/src/datetimepicker/datetimepicker-model.d.ts +14 -0
- package/src/datetimepicker/datetimepicker.d.ts +13 -0
- package/src/datetimepicker/datetimepicker.js +108 -20
- package/src/timepicker/timepicker.d.ts +1 -0
- package/src/timepicker/timepicker.js +20 -6
- package/styles/bootstrap-dark-lite.css +2245 -0
- package/styles/bootstrap-dark-lite.scss +19 -0
- package/styles/bootstrap-dark.css +2261 -1747
- package/styles/bootstrap-dark.scss +6 -2
- package/styles/bootstrap-lite.css +2252 -0
- package/styles/bootstrap-lite.scss +19 -0
- package/styles/bootstrap.css +2261 -1741
- package/styles/bootstrap.scss +6 -2
- package/styles/bootstrap4-lite.css +2273 -0
- package/styles/bootstrap4-lite.scss +19 -0
- package/styles/bootstrap4.css +2278 -1758
- package/styles/bootstrap4.scss +6 -2
- package/styles/bootstrap5-dark-lite.css +2382 -0
- package/styles/bootstrap5-dark-lite.scss +19 -0
- package/styles/bootstrap5-dark.css +2350 -1827
- package/styles/bootstrap5-dark.scss +6 -2
- package/styles/bootstrap5-lite.css +2382 -0
- package/styles/bootstrap5-lite.scss +19 -0
- package/styles/bootstrap5.3-lite.css +2363 -0
- package/styles/bootstrap5.3-lite.scss +19 -0
- package/styles/bootstrap5.3.css +3725 -0
- package/styles/bootstrap5.3.scss +24 -0
- package/styles/bootstrap5.css +2351 -1828
- package/styles/bootstrap5.scss +6 -2
- package/styles/calendar/_bigger.scss +1142 -0
- package/styles/calendar/_bootstrap5.3-definition.scss +7 -3
- package/styles/calendar/_fluent-definition.scss +4 -2
- package/styles/calendar/_fluent2-definition.scss +9 -5
- package/styles/calendar/_layout.scss +7 -251
- package/styles/calendar/_theme.scss +32 -8
- package/styles/calendar/bootstrap-dark.css +681 -369
- package/styles/calendar/bootstrap-dark.scss +1 -0
- package/styles/calendar/bootstrap.css +681 -369
- package/styles/calendar/bootstrap.scss +1 -0
- package/styles/calendar/bootstrap4.css +681 -369
- package/styles/calendar/bootstrap4.scss +1 -0
- package/styles/calendar/bootstrap5-dark.css +704 -390
- package/styles/calendar/bootstrap5-dark.scss +1 -0
- package/styles/calendar/bootstrap5.3.css +1238 -0
- package/styles/calendar/bootstrap5.3.scss +6 -0
- package/styles/calendar/bootstrap5.css +704 -390
- package/styles/calendar/bootstrap5.scss +1 -0
- package/styles/calendar/fabric-dark.css +689 -371
- package/styles/calendar/fabric-dark.scss +1 -0
- package/styles/calendar/fabric.css +693 -373
- package/styles/calendar/fabric.scss +1 -0
- package/styles/calendar/fluent-dark.css +806 -420
- package/styles/calendar/fluent-dark.scss +1 -0
- package/styles/calendar/fluent.css +806 -420
- package/styles/calendar/fluent.scss +1 -0
- package/styles/calendar/fluent2.css +841 -423
- package/styles/calendar/fluent2.scss +1 -0
- package/styles/calendar/highcontrast-light.css +683 -369
- package/styles/calendar/highcontrast-light.scss +1 -0
- package/styles/calendar/highcontrast.css +693 -373
- package/styles/calendar/highcontrast.scss +1 -0
- package/styles/calendar/material-dark.css +693 -373
- package/styles/calendar/material-dark.scss +1 -0
- package/styles/calendar/material.css +693 -373
- package/styles/calendar/material.scss +1 -0
- package/styles/calendar/material3-dark.css +700 -376
- package/styles/calendar/material3-dark.scss +1 -0
- package/styles/calendar/material3.css +700 -376
- package/styles/calendar/material3.scss +1 -0
- package/styles/calendar/tailwind-dark.css +748 -421
- package/styles/calendar/tailwind-dark.scss +1 -0
- package/styles/calendar/tailwind.css +748 -421
- package/styles/calendar/tailwind.scss +1 -0
- package/styles/datepicker/_bigger.scss +82 -0
- package/styles/datepicker/_bootstrap5.3-definition.scss +7 -6
- package/styles/datepicker/_fluent2-definition.scss +2 -2
- package/styles/datepicker/_layout.scss +43 -26
- package/styles/datepicker/_theme.scss +2 -7
- package/styles/datepicker/bootstrap-dark.css +33 -43
- package/styles/datepicker/bootstrap-dark.scss +1 -0
- package/styles/datepicker/bootstrap.css +33 -43
- package/styles/datepicker/bootstrap.scss +1 -0
- package/styles/datepicker/bootstrap4.css +35 -45
- package/styles/datepicker/bootstrap4.scss +1 -0
- package/styles/datepicker/bootstrap5-dark.css +35 -45
- package/styles/datepicker/bootstrap5-dark.scss +1 -0
- package/styles/datepicker/bootstrap5.3.css +453 -0
- package/styles/datepicker/bootstrap5.3.scss +8 -0
- package/styles/datepicker/bootstrap5.css +35 -45
- package/styles/datepicker/bootstrap5.scss +1 -0
- package/styles/datepicker/fabric-dark.css +33 -43
- package/styles/datepicker/fabric-dark.scss +1 -0
- package/styles/datepicker/fabric.css +33 -43
- package/styles/datepicker/fabric.scss +1 -0
- package/styles/datepicker/fluent-dark.css +35 -45
- package/styles/datepicker/fluent-dark.scss +1 -0
- package/styles/datepicker/fluent.css +35 -45
- package/styles/datepicker/fluent.scss +1 -0
- package/styles/datepicker/fluent2.css +40 -52
- package/styles/datepicker/fluent2.scss +1 -0
- package/styles/datepicker/highcontrast-light.css +33 -43
- package/styles/datepicker/highcontrast-light.scss +1 -0
- package/styles/datepicker/highcontrast.css +33 -43
- package/styles/datepicker/highcontrast.scss +1 -0
- package/styles/datepicker/icons/_bds.scss +0 -24
- package/styles/datepicker/icons/_bootstrap-dark.scss +0 -24
- package/styles/datepicker/icons/_bootstrap.scss +0 -22
- package/styles/datepicker/icons/_bootstrap4.scss +0 -24
- package/styles/datepicker/icons/_bootstrap5.3.scss +0 -24
- package/styles/datepicker/icons/_bootstrap5.scss +0 -24
- package/styles/datepicker/icons/_fabric-dark.scss +0 -22
- package/styles/datepicker/icons/_fabric.scss +0 -22
- package/styles/datepicker/icons/_fluent.scss +0 -24
- package/styles/datepicker/icons/_fluent2.scss +0 -31
- package/styles/datepicker/icons/_fusionnew.scss +0 -24
- package/styles/datepicker/icons/_highcontrast-light.scss +0 -22
- package/styles/datepicker/icons/_highcontrast.scss +0 -22
- package/styles/datepicker/icons/_material-dark.scss +0 -40
- package/styles/datepicker/icons/_material.scss +0 -40
- package/styles/datepicker/icons/_material3.scss +0 -29
- package/styles/datepicker/icons/_tailwind.scss +0 -24
- package/styles/datepicker/material-dark.css +50 -60
- package/styles/datepicker/material-dark.scss +1 -0
- package/styles/datepicker/material.css +50 -60
- package/styles/datepicker/material.scss +1 -0
- package/styles/datepicker/material3-dark.css +41 -50
- package/styles/datepicker/material3-dark.scss +1 -0
- package/styles/datepicker/material3.css +41 -50
- package/styles/datepicker/material3.scss +1 -0
- package/styles/datepicker/tailwind-dark.css +40 -50
- package/styles/datepicker/tailwind-dark.scss +1 -0
- package/styles/datepicker/tailwind.css +40 -50
- package/styles/datepicker/tailwind.scss +1 -0
- package/styles/daterangepicker/_bigger.scss +971 -0
- package/styles/daterangepicker/_bootstrap5.3-definition.scss +5 -3
- package/styles/daterangepicker/_fluent-definition.scss +0 -9
- package/styles/daterangepicker/_fluent2-definition.scss +3 -7
- package/styles/daterangepicker/_layout.scss +20 -252
- package/styles/daterangepicker/_theme.scss +20 -68
- package/styles/daterangepicker/bootstrap-dark.css +750 -540
- package/styles/daterangepicker/bootstrap-dark.scss +1 -0
- package/styles/daterangepicker/bootstrap.css +779 -563
- package/styles/daterangepicker/bootstrap.scss +1 -0
- package/styles/daterangepicker/bootstrap4.css +752 -536
- package/styles/daterangepicker/bootstrap4.scss +1 -0
- package/styles/daterangepicker/bootstrap5-dark.css +786 -570
- package/styles/daterangepicker/bootstrap5-dark.scss +1 -0
- package/styles/daterangepicker/bootstrap5.3.css +1500 -0
- package/styles/daterangepicker/bootstrap5.3.scss +8 -0
- package/styles/daterangepicker/bootstrap5.css +786 -570
- package/styles/daterangepicker/bootstrap5.scss +1 -0
- package/styles/daterangepicker/fabric-dark.css +752 -536
- package/styles/daterangepicker/fabric-dark.scss +1 -0
- package/styles/daterangepicker/fabric.css +752 -536
- package/styles/daterangepicker/fabric.scss +1 -0
- package/styles/daterangepicker/fluent-dark.css +817 -592
- package/styles/daterangepicker/fluent-dark.scss +1 -0
- package/styles/daterangepicker/fluent.css +817 -592
- package/styles/daterangepicker/fluent.scss +1 -0
- package/styles/daterangepicker/fluent2.css +791 -571
- package/styles/daterangepicker/fluent2.scss +1 -0
- package/styles/daterangepicker/highcontrast-light.css +752 -536
- package/styles/daterangepicker/highcontrast-light.scss +1 -0
- package/styles/daterangepicker/highcontrast.css +752 -536
- package/styles/daterangepicker/highcontrast.scss +1 -0
- package/styles/daterangepicker/icons/_bds.scss +0 -18
- package/styles/daterangepicker/icons/_bootstrap-dark.scss +0 -24
- package/styles/daterangepicker/icons/_bootstrap.scss +0 -16
- package/styles/daterangepicker/icons/_bootstrap4.scss +0 -19
- package/styles/daterangepicker/icons/_bootstrap5.3.scss +0 -18
- package/styles/daterangepicker/icons/_bootstrap5.scss +0 -18
- package/styles/daterangepicker/icons/_fabric-dark.scss +0 -16
- package/styles/daterangepicker/icons/_fabric.scss +0 -16
- package/styles/daterangepicker/icons/_fluent.scss +0 -18
- package/styles/daterangepicker/icons/_fluent2.scss +0 -41
- package/styles/daterangepicker/icons/_fusionnew.scss +0 -18
- package/styles/daterangepicker/icons/_highcontrast-light.scss +0 -16
- package/styles/daterangepicker/icons/_highcontrast.scss +0 -16
- package/styles/daterangepicker/icons/_material-dark.scss +0 -34
- package/styles/daterangepicker/icons/_material.scss +0 -34
- package/styles/daterangepicker/icons/_material3.scss +0 -39
- package/styles/daterangepicker/icons/_tailwind.scss +0 -18
- package/styles/daterangepicker/material-dark.css +781 -565
- package/styles/daterangepicker/material-dark.scss +1 -0
- package/styles/daterangepicker/material.css +784 -568
- package/styles/daterangepicker/material.scss +1 -0
- package/styles/daterangepicker/material3-dark.css +802 -572
- package/styles/daterangepicker/material3-dark.scss +1 -0
- package/styles/daterangepicker/material3.css +802 -572
- package/styles/daterangepicker/material3.scss +1 -0
- package/styles/daterangepicker/tailwind-dark.css +791 -559
- package/styles/daterangepicker/tailwind-dark.scss +1 -0
- package/styles/daterangepicker/tailwind.css +791 -559
- package/styles/daterangepicker/tailwind.scss +1 -0
- package/styles/datetimepicker/_bigger.scss +105 -0
- package/styles/datetimepicker/_layout.scss +0 -76
- package/styles/datetimepicker/bootstrap-dark.css +42 -42
- package/styles/datetimepicker/bootstrap-dark.scss +1 -0
- package/styles/datetimepicker/bootstrap.css +42 -42
- package/styles/datetimepicker/bootstrap.scss +1 -0
- package/styles/datetimepicker/bootstrap4.css +42 -42
- package/styles/datetimepicker/bootstrap4.scss +1 -0
- package/styles/datetimepicker/bootstrap5-dark.css +42 -42
- package/styles/datetimepicker/bootstrap5-dark.scss +1 -0
- package/styles/datetimepicker/bootstrap5.3.css +227 -0
- package/styles/datetimepicker/bootstrap5.3.scss +9 -0
- package/styles/datetimepicker/bootstrap5.css +42 -42
- package/styles/datetimepicker/bootstrap5.scss +1 -0
- package/styles/datetimepicker/fabric-dark.css +42 -42
- package/styles/datetimepicker/fabric-dark.scss +1 -0
- package/styles/datetimepicker/fabric.css +42 -42
- package/styles/datetimepicker/fabric.scss +1 -0
- package/styles/datetimepicker/fluent-dark.css +42 -42
- package/styles/datetimepicker/fluent-dark.scss +1 -0
- package/styles/datetimepicker/fluent.css +42 -42
- package/styles/datetimepicker/fluent.scss +1 -0
- package/styles/datetimepicker/fluent2.css +42 -42
- package/styles/datetimepicker/fluent2.scss +1 -0
- package/styles/datetimepicker/highcontrast-light.css +42 -42
- package/styles/datetimepicker/highcontrast-light.scss +1 -0
- package/styles/datetimepicker/highcontrast.css +42 -42
- package/styles/datetimepicker/highcontrast.scss +1 -0
- package/styles/datetimepicker/icons/_material-dark.scss +0 -22
- package/styles/datetimepicker/icons/_material.scss +0 -22
- package/styles/datetimepicker/material-dark.css +66 -66
- package/styles/datetimepicker/material-dark.scss +1 -0
- package/styles/datetimepicker/material.css +66 -66
- package/styles/datetimepicker/material.scss +1 -0
- package/styles/datetimepicker/material3-dark.css +53 -53
- package/styles/datetimepicker/material3-dark.scss +1 -0
- package/styles/datetimepicker/material3.css +53 -53
- package/styles/datetimepicker/material3.scss +1 -0
- package/styles/datetimepicker/tailwind-dark.css +42 -42
- package/styles/datetimepicker/tailwind-dark.scss +1 -0
- package/styles/datetimepicker/tailwind.css +42 -42
- package/styles/datetimepicker/tailwind.scss +1 -0
- package/styles/fabric-dark-lite.css +2251 -0
- package/styles/fabric-dark-lite.scss +19 -0
- package/styles/fabric-dark.css +2268 -1742
- package/styles/fabric-dark.scss +6 -2
- package/styles/fabric-lite.css +2255 -0
- package/styles/fabric-lite.scss +19 -0
- package/styles/fabric.css +2265 -1737
- package/styles/fabric.scss +6 -2
- package/styles/fluent-dark-lite.css +2509 -0
- package/styles/fluent-dark-lite.scss +19 -0
- package/styles/fluent-dark.css +2456 -1853
- package/styles/fluent-dark.scss +6 -2
- package/styles/fluent-lite.css +2509 -0
- package/styles/fluent-lite.scss +19 -0
- package/styles/fluent.css +2456 -1853
- package/styles/fluent.scss +6 -2
- package/styles/fluent2-lite.css +2606 -0
- package/styles/fluent2-lite.scss +19 -0
- package/styles/fluent2.css +2410 -1781
- package/styles/fluent2.scss +6 -2
- package/styles/highcontrast-light-lite.css +2259 -0
- package/styles/highcontrast-light-lite.scss +19 -0
- package/styles/highcontrast-light.css +2264 -1742
- package/styles/highcontrast-light.scss +6 -2
- package/styles/highcontrast-lite.css +2268 -0
- package/styles/highcontrast-lite.scss +19 -0
- package/styles/highcontrast.css +2273 -1745
- package/styles/highcontrast.scss +6 -2
- package/styles/material-dark-lite.css +2345 -0
- package/styles/material-dark-lite.scss +19 -0
- package/styles/material-dark.css +2371 -1843
- package/styles/material-dark.scss +6 -2
- package/styles/material-lite.css +2375 -0
- package/styles/material-lite.scss +19 -0
- package/styles/material.css +2363 -1835
- package/styles/material.scss +6 -2
- package/styles/material3-dark-lite.css +2400 -0
- package/styles/material3-dark-lite.scss +19 -0
- package/styles/material3-dark.css +2414 -1867
- package/styles/material3-dark.scss +6 -2
- package/styles/material3-lite.css +2402 -0
- package/styles/material3-lite.scss +19 -0
- package/styles/material3.css +2414 -1867
- package/styles/material3.scss +6 -2
- package/styles/tailwind-dark-lite.css +2327 -0
- package/styles/tailwind-dark-lite.scss +19 -0
- package/styles/tailwind-dark.css +2362 -1811
- package/styles/tailwind-dark.scss +6 -2
- package/styles/tailwind-lite.css +2327 -0
- package/styles/tailwind-lite.scss +19 -0
- package/styles/tailwind.css +2363 -1812
- package/styles/tailwind.scss +6 -2
- package/styles/timepicker/_bigger.scss +92 -0
- package/styles/timepicker/_layout.scss +0 -62
- package/styles/timepicker/_theme.scss +2 -4
- package/styles/timepicker/bootstrap-dark.css +44 -41
- package/styles/timepicker/bootstrap-dark.scss +1 -0
- package/styles/timepicker/bootstrap.css +44 -41
- package/styles/timepicker/bootstrap.scss +1 -0
- package/styles/timepicker/bootstrap4.css +44 -41
- package/styles/timepicker/bootstrap4.scss +1 -0
- package/styles/timepicker/bootstrap5-dark.css +44 -41
- package/styles/timepicker/bootstrap5-dark.scss +1 -0
- package/styles/timepicker/bootstrap5.3.css +327 -0
- package/styles/timepicker/bootstrap5.3.scss +7 -0
- package/styles/timepicker/bootstrap5.css +44 -41
- package/styles/timepicker/bootstrap5.scss +1 -0
- package/styles/timepicker/fabric-dark.css +44 -41
- package/styles/timepicker/fabric-dark.scss +1 -0
- package/styles/timepicker/fabric.css +44 -41
- package/styles/timepicker/fabric.scss +1 -0
- package/styles/timepicker/fluent-dark.css +44 -41
- package/styles/timepicker/fluent-dark.scss +1 -0
- package/styles/timepicker/fluent.css +44 -41
- package/styles/timepicker/fluent.scss +1 -0
- package/styles/timepicker/fluent2.css +44 -41
- package/styles/timepicker/fluent2.scss +1 -0
- package/styles/timepicker/highcontrast-light.css +44 -41
- package/styles/timepicker/highcontrast-light.scss +1 -0
- package/styles/timepicker/highcontrast.css +44 -41
- package/styles/timepicker/highcontrast.scss +1 -0
- package/styles/timepicker/icons/_material-dark.scss +0 -15
- package/styles/timepicker/icons/_material.scss +0 -15
- package/styles/timepicker/material-dark.css +61 -58
- package/styles/timepicker/material-dark.scss +1 -0
- package/styles/timepicker/material.css +61 -58
- package/styles/timepicker/material.scss +1 -0
- package/styles/timepicker/material3-dark.css +52 -49
- package/styles/timepicker/material3-dark.scss +1 -0
- package/styles/timepicker/material3.css +52 -49
- package/styles/timepicker/material3.scss +1 -0
- package/styles/timepicker/tailwind-dark.css +44 -41
- package/styles/timepicker/tailwind-dark.scss +1 -0
- package/styles/timepicker/tailwind.css +44 -41
- package/styles/timepicker/tailwind.scss +1 -0
|
@@ -142,7 +142,6 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
142
142
|
if (this.showClearButton) {
|
|
143
143
|
this.clearButton = document.getElementsByClassName('e-clear-icon')[0];
|
|
144
144
|
}
|
|
145
|
-
this.hide(null);
|
|
146
145
|
if (this.popupObject && this.popupObject.element.classList.contains(POPUP)) {
|
|
147
146
|
this.popupObject.destroy();
|
|
148
147
|
detach(this.dateTimeWrapper);
|
|
@@ -215,6 +214,12 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
215
214
|
if (typeof (this.max) === 'string') {
|
|
216
215
|
this.max = this.checkDateValue(new Date(this.max));
|
|
217
216
|
}
|
|
217
|
+
if (typeof (this.minTime) === 'string') {
|
|
218
|
+
this.minTime = this.checkDateValue(new Date(this.minTime));
|
|
219
|
+
}
|
|
220
|
+
if (typeof (this.maxTime) === 'string') {
|
|
221
|
+
this.maxTime = this.checkDateValue(new Date(this.maxTime));
|
|
222
|
+
}
|
|
218
223
|
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
219
224
|
this.enabled = false;
|
|
220
225
|
}
|
|
@@ -286,7 +291,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
286
291
|
DateTimePicker.prototype.checkValidState = function (value) {
|
|
287
292
|
this.isValidState = true;
|
|
288
293
|
if (!this.strictMode) {
|
|
289
|
-
if ((+(value) > +(this.max)) || (+(value) < +(this.min))) {
|
|
294
|
+
if ((+(value) > +(this.max)) || (+(value) < +(this.min)) || !this.isValidTime(value)) {
|
|
290
295
|
this.isValidState = false;
|
|
291
296
|
}
|
|
292
297
|
}
|
|
@@ -301,6 +306,54 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
301
306
|
}
|
|
302
307
|
attributes(this.inputElement, { 'aria-invalid': this.isValidState ? 'false' : 'true' });
|
|
303
308
|
};
|
|
309
|
+
DateTimePicker.prototype.isValidTime = function (value) {
|
|
310
|
+
if (value != null && (this.minTime || this.maxTime)) {
|
|
311
|
+
var minTimeValue = void 0;
|
|
312
|
+
var maxTimeValue = void 0;
|
|
313
|
+
var maxValue = void 0;
|
|
314
|
+
var minValue = void 0;
|
|
315
|
+
var valueTime = value.getHours() * 3600000 + value.getMinutes() * 60000 +
|
|
316
|
+
value.getSeconds() * 1000 + value.getMilliseconds();
|
|
317
|
+
if (this.minTime) {
|
|
318
|
+
minTimeValue = this.minTime.getHours() * 3600000 + this.minTime.getMinutes() * 60000 +
|
|
319
|
+
this.minTime.getSeconds() * 1000 + this.minTime.getMilliseconds();
|
|
320
|
+
}
|
|
321
|
+
if (this.maxTime) {
|
|
322
|
+
maxTimeValue = this.maxTime.getHours() * 3600000 + this.maxTime.getMinutes() * 60000 +
|
|
323
|
+
this.maxTime.getSeconds() * 1000 + this.maxTime.getMilliseconds();
|
|
324
|
+
}
|
|
325
|
+
if (this.min && (+value.getDate() === +this.min.getDate() && +value.getMonth() === +this.min.getMonth() &&
|
|
326
|
+
+value.getFullYear() === +this.min.getFullYear())) {
|
|
327
|
+
minValue = this.min.getHours() * 3600000 + this.min.getMinutes() * 60000 +
|
|
328
|
+
this.min.getSeconds() * 1000 + this.min.getMilliseconds();
|
|
329
|
+
minTimeValue = minTimeValue < minValue ? minValue : minTimeValue;
|
|
330
|
+
}
|
|
331
|
+
if (this.max && (+value.getDate() === +this.max.getDate() && +value.getMonth() === +this.max.getMonth() &&
|
|
332
|
+
+this.max.getFullYear() === +this.max.getFullYear())) {
|
|
333
|
+
maxValue = this.max.getHours() * 3600000 + this.max.getMinutes() * 60000 +
|
|
334
|
+
this.max.getSeconds() * 1000 + this.max.getMilliseconds();
|
|
335
|
+
maxTimeValue = maxTimeValue > maxValue ? maxValue : maxTimeValue;
|
|
336
|
+
}
|
|
337
|
+
if (this.strictMode) {
|
|
338
|
+
var newValue = void 0;
|
|
339
|
+
if (minTimeValue && valueTime < minTimeValue) {
|
|
340
|
+
newValue = new Date(value.getFullYear(), value.getMonth(), value.getDate(), this.minTime.getHours(), this.minTime.getMinutes(), this.minTime.getSeconds(), this.minTime.getMilliseconds());
|
|
341
|
+
this.setProperties({ value: newValue }, true);
|
|
342
|
+
this.changedArgs = { value: this.value };
|
|
343
|
+
}
|
|
344
|
+
else if (maxTimeValue && valueTime > maxTimeValue) {
|
|
345
|
+
newValue = new Date(value.getFullYear(), value.getMonth(), value.getDate(), this.maxTime.getHours(), this.maxTime.getMinutes(), this.maxTime.getSeconds(), this.maxTime.getMilliseconds());
|
|
346
|
+
this.setProperties({ value: newValue }, true);
|
|
347
|
+
this.changedArgs = { value: this.value };
|
|
348
|
+
}
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
return !((minTimeValue && valueTime < minTimeValue) || (maxTimeValue && valueTime > maxTimeValue));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return true;
|
|
356
|
+
};
|
|
304
357
|
DateTimePicker.prototype.validateValue = function (value) {
|
|
305
358
|
var dateVal = value;
|
|
306
359
|
if (this.strictMode) {
|
|
@@ -519,12 +572,12 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
519
572
|
if (this.dateFormatString === '') {
|
|
520
573
|
this.dateFormatString = this.cldrDateTimeFormat();
|
|
521
574
|
}
|
|
522
|
-
dateObject = this.globalize.parseDate(this.inputElement.value, {
|
|
575
|
+
dateObject = this.globalize.parseDate(this.getAmPmValue(this.inputElement.value), {
|
|
523
576
|
format: this.dateFormatString, type: 'datetime'
|
|
524
577
|
});
|
|
525
578
|
}
|
|
526
579
|
else {
|
|
527
|
-
dateObject = this.globalize.parseDate(this.inputElement.value, {
|
|
580
|
+
dateObject = this.globalize.parseDate(this.getAmPmValue(this.inputElement.value), {
|
|
528
581
|
format: this.cldrDateTimeFormat(), type: 'datetime', calendar: 'islamic'
|
|
529
582
|
});
|
|
530
583
|
}
|
|
@@ -997,20 +1050,35 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
997
1050
|
var tempStartValue;
|
|
998
1051
|
var start;
|
|
999
1052
|
var tempMin = this.min;
|
|
1053
|
+
var tempMax = this.max;
|
|
1000
1054
|
var value = date === null ? new Date() : date;
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1055
|
+
var isModified = false;
|
|
1056
|
+
var startValue;
|
|
1057
|
+
if (this.minTime) {
|
|
1058
|
+
startValue = new Date(value.getFullYear(), value.getMonth(), value.getDate(), this.minTime.getHours(), this.minTime.getMinutes(), this.minTime.getSeconds(), this.minTime.getMilliseconds());
|
|
1059
|
+
isModified = true;
|
|
1060
|
+
}
|
|
1061
|
+
else {
|
|
1062
|
+
startValue = value;
|
|
1063
|
+
}
|
|
1064
|
+
if ((+startValue.getDate() === +tempMin.getDate() && +startValue.getMonth() === +tempMin.getMonth() &&
|
|
1065
|
+
+startValue.getFullYear() === +tempMin.getFullYear()) ||
|
|
1066
|
+
((+new Date(startValue.getFullYear(), startValue.getMonth(), startValue.getDate())) <=
|
|
1067
|
+
+new Date(tempMin.getFullYear(), tempMin.getMonth(), tempMin.getDate()))) {
|
|
1004
1068
|
start = false;
|
|
1005
|
-
tempStartValue =
|
|
1069
|
+
tempStartValue = tempMin;
|
|
1070
|
+
if (isModified && ((+new Date(startValue.getFullYear(), startValue.getMonth(), startValue.getDate(), startValue.getHours(), startValue.getMinutes(), startValue.getSeconds(), startValue.getMilliseconds())) >=
|
|
1071
|
+
+new Date(tempMin.getFullYear(), tempMin.getMonth(), tempMin.getDate(), tempMin.getHours(), tempMin.getMinutes(), tempMin.getSeconds(), tempMin.getMilliseconds()))) {
|
|
1072
|
+
tempStartValue.setHours(startValue.getHours(), startValue.getMinutes(), startValue.getSeconds(), startValue.getMilliseconds());
|
|
1073
|
+
}
|
|
1006
1074
|
}
|
|
1007
|
-
else if (+
|
|
1008
|
-
start =
|
|
1009
|
-
tempStartValue =
|
|
1075
|
+
else if (+startValue < +tempMax && +startValue > +tempMin) {
|
|
1076
|
+
start = !isModified;
|
|
1077
|
+
tempStartValue = startValue;
|
|
1010
1078
|
}
|
|
1011
|
-
else if (+
|
|
1079
|
+
else if (+startValue >= +tempMax) {
|
|
1012
1080
|
start = true;
|
|
1013
|
-
tempStartValue =
|
|
1081
|
+
tempStartValue = tempMax;
|
|
1014
1082
|
}
|
|
1015
1083
|
return this.calculateStartEnd(tempStartValue, start, 'starttime');
|
|
1016
1084
|
};
|
|
@@ -1059,17 +1127,31 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
1059
1127
|
var end;
|
|
1060
1128
|
var tempMax = this.max;
|
|
1061
1129
|
var value = date === null ? new Date() : date;
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1130
|
+
var isModified = false;
|
|
1131
|
+
var endValue;
|
|
1132
|
+
if (this.maxTime) {
|
|
1133
|
+
endValue = new Date(value.getFullYear(), value.getMonth(), value.getDate(), this.maxTime.getHours(), this.maxTime.getMinutes(), this.maxTime.getSeconds(), this.maxTime.getMilliseconds());
|
|
1134
|
+
isModified = true;
|
|
1135
|
+
}
|
|
1136
|
+
else {
|
|
1137
|
+
endValue = value;
|
|
1138
|
+
}
|
|
1139
|
+
if ((+endValue.getDate() === +tempMax.getDate() && +endValue.getMonth() === +tempMax.getMonth() &&
|
|
1140
|
+
+endValue.getFullYear() === +tempMax.getFullYear()) ||
|
|
1141
|
+
(+new Date(endValue.getUTCFullYear(), endValue.getMonth(), endValue.getDate()) >=
|
|
1142
|
+
+new Date(tempMax.getFullYear(), tempMax.getMonth(), tempMax.getDate()))) {
|
|
1065
1143
|
end = false;
|
|
1066
1144
|
tempEndValue = this.max;
|
|
1145
|
+
if (isModified && (+new Date(endValue.getUTCFullYear(), endValue.getMonth(), endValue.getDate(), endValue.getHours(), endValue.getMinutes(), endValue.getSeconds(), endValue.getMilliseconds()) <=
|
|
1146
|
+
+new Date(tempMax.getFullYear(), tempMax.getMonth(), tempMax.getDate(), tempMax.getHours(), tempMax.getMinutes(), tempMax.getSeconds(), tempMax.getMilliseconds()))) {
|
|
1147
|
+
tempEndValue.setHours(endValue.getHours(), endValue.getMinutes(), endValue.getSeconds(), endValue.getMilliseconds());
|
|
1148
|
+
}
|
|
1067
1149
|
}
|
|
1068
|
-
else if (+
|
|
1069
|
-
end =
|
|
1070
|
-
tempEndValue =
|
|
1150
|
+
else if (+endValue < +this.max && +endValue > +this.min) {
|
|
1151
|
+
end = !isModified;
|
|
1152
|
+
tempEndValue = endValue;
|
|
1071
1153
|
}
|
|
1072
|
-
else if (+
|
|
1154
|
+
else if (+endValue <= +this.min) {
|
|
1073
1155
|
end = true;
|
|
1074
1156
|
tempEndValue = this.min;
|
|
1075
1157
|
}
|
|
@@ -1672,6 +1754,12 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
1672
1754
|
__decorate([
|
|
1673
1755
|
Property(new Date(2099, 11, 31))
|
|
1674
1756
|
], DateTimePicker.prototype, "max", void 0);
|
|
1757
|
+
__decorate([
|
|
1758
|
+
Property(null)
|
|
1759
|
+
], DateTimePicker.prototype, "minTime", void 0);
|
|
1760
|
+
__decorate([
|
|
1761
|
+
Property(null)
|
|
1762
|
+
], DateTimePicker.prototype, "maxTime", void 0);
|
|
1675
1763
|
__decorate([
|
|
1676
1764
|
Property(null)
|
|
1677
1765
|
], DateTimePicker.prototype, "firstDayOfWeek", void 0);
|
|
@@ -514,6 +514,7 @@ export declare class TimePicker extends Component<HTMLElement> implements IInput
|
|
|
514
514
|
private getCldrDateTimeFormat;
|
|
515
515
|
private checkInvalidValue;
|
|
516
516
|
requiredModules(): ModuleDeclaration[];
|
|
517
|
+
protected getAmPmValue(date: string | null | undefined): string;
|
|
517
518
|
private cldrFormat;
|
|
518
519
|
destroy(): void;
|
|
519
520
|
protected ensureInputAttribute(): void;
|
|
@@ -403,18 +403,18 @@ var TimePicker = /** @class */ (function (_super) {
|
|
|
403
403
|
if (!(/^[a-zA-Z0-9- ]*$/).test(value)) {
|
|
404
404
|
valueExpression = this.setCurrentDate(this.getDateObject(value));
|
|
405
405
|
if (isNullOrUndefined(valueExpression)) {
|
|
406
|
-
valueExpression = this.checkDateValue(this.globalize.parseDate(valueString, {
|
|
406
|
+
valueExpression = this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(valueString), {
|
|
407
407
|
format: this.getCldrDateTimeFormat(), type: 'datetime'
|
|
408
408
|
}));
|
|
409
409
|
if (isNullOrUndefined(valueExpression)) {
|
|
410
|
-
valueExpression = this.checkDateValue(this.globalize.parseDate(valueString, {
|
|
410
|
+
valueExpression = this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(valueString), {
|
|
411
411
|
format: this.formatString, type: 'dateTime', skeleton: 'yMd'
|
|
412
412
|
}));
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
valueExp = this.globalize.parseDate(valueString, {
|
|
417
|
+
valueExp = this.globalize.parseDate(this.getAmPmValue(valueString), {
|
|
418
418
|
format: this.getCldrDateTimeFormat(), type: 'datetime'
|
|
419
419
|
});
|
|
420
420
|
valueExpression = (!isNullOrUndefined(valueExp) && valueExp instanceof Date && !isNaN(+valueExp)) ? valueExp : null;
|
|
@@ -453,6 +453,20 @@ var TimePicker = /** @class */ (function (_super) {
|
|
|
453
453
|
}
|
|
454
454
|
return modules;
|
|
455
455
|
};
|
|
456
|
+
TimePicker.prototype.getAmPmValue = function (date) {
|
|
457
|
+
try {
|
|
458
|
+
if (typeof date === 'string' && date.trim() !== '') {
|
|
459
|
+
// Replace am/pm variants with uppercase AM/PM
|
|
460
|
+
return date.replace(/(am|pm|Am|aM|pM|Pm)/g, function (match) { return match.toLocaleUpperCase(); });
|
|
461
|
+
}
|
|
462
|
+
// If date is null, undefined, or an empty string, return a default value or empty string
|
|
463
|
+
return '';
|
|
464
|
+
}
|
|
465
|
+
catch (error) {
|
|
466
|
+
console.error('Error occurred while processing date:', error);
|
|
467
|
+
return ''; // Return a default value in case of an error
|
|
468
|
+
}
|
|
469
|
+
};
|
|
456
470
|
TimePicker.prototype.cldrFormat = function (type) {
|
|
457
471
|
var cldrDateTimeString;
|
|
458
472
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
@@ -1228,7 +1242,7 @@ var TimePicker = /** @class */ (function (_super) {
|
|
|
1228
1242
|
return dateVal;
|
|
1229
1243
|
};
|
|
1230
1244
|
TimePicker.prototype.valueIsDisable = function (value) {
|
|
1231
|
-
if (this.disableItemCollection.length > 0) {
|
|
1245
|
+
if (!isNullOrUndefined(this.disableItemCollection) && this.disableItemCollection.length > 0) {
|
|
1232
1246
|
if (this.disableItemCollection.length === this.timeCollections.length) {
|
|
1233
1247
|
return false;
|
|
1234
1248
|
}
|
|
@@ -1960,10 +1974,10 @@ var TimePicker = /** @class */ (function (_super) {
|
|
|
1960
1974
|
};
|
|
1961
1975
|
TimePicker.prototype.timeParse = function (today, val) {
|
|
1962
1976
|
var value;
|
|
1963
|
-
value = this.globalize.parseDate(today + ' ' + val, {
|
|
1977
|
+
value = this.globalize.parseDate(this.getAmPmValue(today + ' ' + val), {
|
|
1964
1978
|
format: this.cldrDateFormat() + ' ' + this.cldrTimeFormat(), type: 'datetime'
|
|
1965
1979
|
});
|
|
1966
|
-
value = isNullOrUndefined(value) ? this.globalize.parseDate(today + ' ' + val, {
|
|
1980
|
+
value = isNullOrUndefined(value) ? this.globalize.parseDate(this.getAmPmValue(today + ' ' + val), {
|
|
1967
1981
|
format: this.cldrDateFormat() + ' ' + this.dateToNumeric(), type: 'datetime'
|
|
1968
1982
|
}) : value;
|
|
1969
1983
|
value = isNullOrUndefined(value) ? value : new Date(value.setMilliseconds(0));
|