@syncfusion/ej2-calendars 29.2.11 → 30.2.4
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/.eslintrc.json +2 -0
- package/aceconfig.js +17 -0
- 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 +77 -11
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +78 -10
- 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 +6 -6
- package/src/calendar/calendar.js +6 -6
- package/src/calendar/islamic.js +20 -4
- package/src/daterangepicker/daterangepicker-model.d.ts +8 -0
- package/src/daterangepicker/daterangepicker.d.ts +9 -0
- package/src/daterangepicker/daterangepicker.js +52 -0
- package/styles/calendar/_layout.scss +6 -0
- package/styles/calendar/tailwind3.css +5 -0
- package/styles/daterangepicker/_fluent2-definition.scss +2 -1
- package/styles/daterangepicker/fluent2.css +2 -1
- package/styles/datetimepicker/_fluent2-definition.scss +1 -1
- package/styles/datetimepicker/fluent2.css +1 -1
- package/styles/fluent2-lite.css +3 -2
- package/styles/fluent2.css +3 -2
- package/styles/tailwind3-lite.css +5 -0
- package/styles/tailwind3.css +5 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 30.2.4
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-calendars",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "30.2.4",
|
|
4
4
|
"description": "A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.",
|
|
5
5
|
"author": "Syncfusion Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN license",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"module": "./index.js",
|
|
9
9
|
"es2015": "./dist/es6/ej2-calendars.es5.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@syncfusion/ej2-base": "~
|
|
12
|
-
"@syncfusion/ej2-buttons": "~
|
|
13
|
-
"@syncfusion/ej2-inputs": "~
|
|
14
|
-
"@syncfusion/ej2-lists": "~
|
|
15
|
-
"@syncfusion/ej2-popups": "~
|
|
11
|
+
"@syncfusion/ej2-base": "~30.2.4",
|
|
12
|
+
"@syncfusion/ej2-buttons": "~30.2.4",
|
|
13
|
+
"@syncfusion/ej2-inputs": "~30.2.4",
|
|
14
|
+
"@syncfusion/ej2-lists": "~30.2.4",
|
|
15
|
+
"@syncfusion/ej2-popups": "~30.2.4"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {},
|
|
18
18
|
"keywords": [
|
package/src/calendar/calendar.js
CHANGED
|
@@ -100,10 +100,10 @@ var CalendarBase = /** @class */ (function (_super) {
|
|
|
100
100
|
this.calendarEleCopy = this.element.cloneNode(true);
|
|
101
101
|
if (this.calendarMode === 'Islamic') {
|
|
102
102
|
if (+(this.min.setSeconds(0)) === +new Date(1900, 0, 1, 0, 0, 0)) {
|
|
103
|
-
this.min = new Date(
|
|
103
|
+
this.min = new Date(1941, 12, 18);
|
|
104
104
|
}
|
|
105
105
|
if (+this.max === +new Date(2099, 11, 31)) {
|
|
106
|
-
this.max = new Date(
|
|
106
|
+
this.max = new Date(2068, 2, 4);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
this.globalize = new Internationalization(this.locale);
|
|
@@ -1966,10 +1966,10 @@ var CalendarBase = /** @class */ (function (_super) {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
else {
|
|
1968
1968
|
var islamicDate = this.islamicModule.getIslamicDate(date);
|
|
1969
|
-
return islamicDate.month >= (this.islamicModule.getIslamicDate(new Date(
|
|
1970
|
-
&& islamicDate.year >= (this.islamicModule.getIslamicDate(new Date(
|
|
1971
|
-
&& islamicDate.month <= (this.islamicModule.getIslamicDate(new Date(
|
|
1972
|
-
&& islamicDate.year <= (this.islamicModule.getIslamicDate(new Date(
|
|
1969
|
+
return (islamicDate.month >= (this.islamicModule.getIslamicDate(new Date(1941, 12, 18))).month)
|
|
1970
|
+
&& islamicDate.year >= (this.islamicModule.getIslamicDate(new Date(1941, 12, 18))).year
|
|
1971
|
+
&& islamicDate.month <= (this.islamicModule.getIslamicDate(new Date(2068, 2, 4))).month
|
|
1972
|
+
&& islamicDate.year <= (this.islamicModule.getIslamicDate(new Date(2068, 2, 4))).year;
|
|
1973
1973
|
}
|
|
1974
1974
|
};
|
|
1975
1975
|
CalendarBase.prototype.compareYear = function (start, end) {
|
package/src/calendar/islamic.js
CHANGED
|
@@ -23,7 +23,7 @@ var TODAY = 'e-today';
|
|
|
23
23
|
var LINK = 'e-day';
|
|
24
24
|
var CELL = 'e-cell';
|
|
25
25
|
var dayMilliSeconds = 86400000;
|
|
26
|
-
var minDecade =
|
|
26
|
+
var minDecade = 2058;
|
|
27
27
|
var maxDecade = 2069;
|
|
28
28
|
var Islamic = /** @class */ (function () {
|
|
29
29
|
function Islamic(instance) {
|
|
@@ -297,9 +297,21 @@ var Islamic = /** @class */ (function () {
|
|
|
297
297
|
var endFullYr = endYr.getFullYear();
|
|
298
298
|
var startHdrYr = this.calendarInstance.globalize.formatDate(startYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
|
|
299
299
|
var endHdrYr = this.calendarInstance.globalize.formatDate(endYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
|
|
300
|
+
if (islamicDate.year % 10 === 1) {
|
|
301
|
+
startHdrYr = islamicDate.year;
|
|
302
|
+
endHdrYr = islamicDate.year + 9;
|
|
303
|
+
}
|
|
304
|
+
else if (islamicDate.year % 10 > 1) {
|
|
305
|
+
startHdrYr = islamicDate.year - ((islamicDate.year % 10) - 1);
|
|
306
|
+
endHdrYr = startHdrYr + 9;
|
|
307
|
+
}
|
|
308
|
+
else if (islamicDate.year % 10 === 0) {
|
|
309
|
+
startHdrYr = islamicDate.year - 9;
|
|
310
|
+
endHdrYr = islamicDate.year;
|
|
311
|
+
}
|
|
300
312
|
if (this.calendarInstance.locale === 'ar') {
|
|
301
|
-
startHdrYr = Number(startHdrYr.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (d) { return String.fromCharCode(d.charCodeAt(0) - 1632 + 48); }));
|
|
302
|
-
endHdrYr = Number(endHdrYr.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (d) { return String.fromCharCode(d.charCodeAt(0) - 1632 + 48); }));
|
|
313
|
+
startHdrYr = Number(startHdrYr.toString().replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (d) { return String.fromCharCode(d.charCodeAt(0) - 1632 + 48); }));
|
|
314
|
+
endHdrYr = Number(endHdrYr.toString().replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (d) { return String.fromCharCode(d.charCodeAt(0) - 1632 + 48); }));
|
|
303
315
|
}
|
|
304
316
|
var splityear = this.calendarInstance.headerElement.textContent.split('-');
|
|
305
317
|
if ((!isNullOrUndefined(e) && (splityear[0] !== startHdrYr) && e.action === 'home') ||
|
|
@@ -398,6 +410,10 @@ var Islamic = /** @class */ (function () {
|
|
|
398
410
|
if (islamicDate.year === parseInt(startHdrYr, 10) - 1 || (year_1 < startFullYr) ||
|
|
399
411
|
(year_1 > endFullYr) && islamicDate.year !== parseInt(endHdrYr, 10)) {
|
|
400
412
|
addClass([tdEle], OTHERMONTH);
|
|
413
|
+
if (year_1 <= new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()
|
|
414
|
+
|| year_1 >= new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()) {
|
|
415
|
+
addClass([tdEle], DISABLED);
|
|
416
|
+
}
|
|
401
417
|
}
|
|
402
418
|
else if (year_1 < new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()
|
|
403
419
|
|| year_1 > new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()) {
|
|
@@ -409,7 +425,7 @@ var Islamic = /** @class */ (function () {
|
|
|
409
425
|
addClass([tdEle], SELECTED);
|
|
410
426
|
}
|
|
411
427
|
else {
|
|
412
|
-
if (
|
|
428
|
+
if (this.getIslamicDate(localDate).year === this.getIslamicDate(this.calendarInstance.currentDate).year &&
|
|
413
429
|
!tdEle.classList.contains(DISABLED)) {
|
|
414
430
|
addClass([tdEle], FOCUSEDDATE);
|
|
415
431
|
}
|
|
@@ -396,6 +396,14 @@ export interface DateRangePickerModel extends CalendarBaseModel{
|
|
|
396
396
|
*/
|
|
397
397
|
format?: string | RangeFormatObject;
|
|
398
398
|
|
|
399
|
+
/**
|
|
400
|
+
* Specifies an array of acceptable date input formats for parsing user input.
|
|
401
|
+
*
|
|
402
|
+
* @default null
|
|
403
|
+
* @aspType string[]
|
|
404
|
+
*/
|
|
405
|
+
inputFormats?: string[] | RangeFormatObject[];
|
|
406
|
+
|
|
399
407
|
/**
|
|
400
408
|
* Specifies the component to be disabled which prevents the DateRangePicker from user interactions.
|
|
401
409
|
*
|
|
@@ -164,6 +164,7 @@ export declare class DateRangePicker extends CalendarBase {
|
|
|
164
164
|
private endCopy;
|
|
165
165
|
private formElement;
|
|
166
166
|
private formatString;
|
|
167
|
+
private inputFormatsString;
|
|
167
168
|
protected tabIndex: string;
|
|
168
169
|
private invalidValueString;
|
|
169
170
|
private dateRangeOptions;
|
|
@@ -509,6 +510,13 @@ export declare class DateRangePicker extends CalendarBase {
|
|
|
509
510
|
* @default null
|
|
510
511
|
*/
|
|
511
512
|
format: string | RangeFormatObject;
|
|
513
|
+
/**
|
|
514
|
+
* Specifies an array of acceptable date input formats for parsing user input.
|
|
515
|
+
*
|
|
516
|
+
* @default null
|
|
517
|
+
* @aspType string[]
|
|
518
|
+
*/
|
|
519
|
+
inputFormats: string[] | RangeFormatObject[];
|
|
512
520
|
/**
|
|
513
521
|
* Specifies the component to be disabled which prevents the DateRangePicker from user interactions.
|
|
514
522
|
*
|
|
@@ -614,6 +622,7 @@ export declare class DateRangePicker extends CalendarBase {
|
|
|
614
622
|
private updateValue;
|
|
615
623
|
private initProperty;
|
|
616
624
|
protected checkFormat(): void;
|
|
625
|
+
protected checkInputFormats(): void;
|
|
617
626
|
private initialize;
|
|
618
627
|
private setDataAttribute;
|
|
619
628
|
private setRangeAllowEdit;
|
|
@@ -234,6 +234,9 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
234
234
|
this.value = [new Date(rangeArray[0]), new Date(rangeArray[1])];
|
|
235
235
|
}
|
|
236
236
|
this.initProperty();
|
|
237
|
+
if (this.inputFormats) {
|
|
238
|
+
this.checkInputFormats();
|
|
239
|
+
}
|
|
237
240
|
this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
|
|
238
241
|
this.element.removeAttribute('tabindex');
|
|
239
242
|
_super.prototype.preRender.call(this);
|
|
@@ -347,6 +350,31 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
347
350
|
this.formatString = null;
|
|
348
351
|
}
|
|
349
352
|
};
|
|
353
|
+
DateRangePicker.prototype.checkInputFormats = function () {
|
|
354
|
+
this.inputFormatsString = [];
|
|
355
|
+
if (this.inputFormats) {
|
|
356
|
+
for (var _i = 0, _a = this.inputFormats; _i < _a.length; _i++) {
|
|
357
|
+
var format = _a[_i];
|
|
358
|
+
var formatString = '';
|
|
359
|
+
if (typeof format === 'string') {
|
|
360
|
+
formatString = format;
|
|
361
|
+
}
|
|
362
|
+
else if (format.skeleton !== '' && !isNullOrUndefined(format.skeleton)) {
|
|
363
|
+
var skeletonString = format.skeleton;
|
|
364
|
+
formatString = this.globalize.getDatePattern({ skeleton: skeletonString, type: 'date' });
|
|
365
|
+
}
|
|
366
|
+
if (formatString) {
|
|
367
|
+
this.inputFormatsString.push(formatString);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (this.inputFormatsString.length === 0) {
|
|
371
|
+
this.inputFormatsString = null;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
this.inputFormatsString = null;
|
|
376
|
+
}
|
|
377
|
+
};
|
|
350
378
|
DateRangePicker.prototype.initialize = function () {
|
|
351
379
|
if (this.angularTag !== null) {
|
|
352
380
|
this.validationAttribute(this.element, this.inputElement);
|
|
@@ -990,6 +1018,24 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
990
1018
|
endDate = this.max;
|
|
991
1019
|
}
|
|
992
1020
|
}
|
|
1021
|
+
if (((isNullOrUndefined(startDate) || (typeof (startDate) === 'object' && isNaN(startDate.getTime()))
|
|
1022
|
+
|| isNullOrUndefined(endDate)) || (typeof (endDate) === 'object' && isNaN(endDate.getTime())))
|
|
1023
|
+
&& !isNullOrUndefined(this.inputFormatsString)) {
|
|
1024
|
+
for (var _i = 0, _a = this.inputFormatsString; _i < _a.length; _i++) {
|
|
1025
|
+
var format = _a[_i];
|
|
1026
|
+
var inputFormatOptions = { format: format, type: 'date', skeleton: 'yMd' };
|
|
1027
|
+
if (isNullOrUndefined(startDate) || (typeof (startDate) === 'object' && isNaN(startDate.getTime()))) {
|
|
1028
|
+
startDate = this.globalize.parseDate(this.getAmPmValue(range[0]).trim(), inputFormatOptions);
|
|
1029
|
+
}
|
|
1030
|
+
if (isNullOrUndefined(endDate) || (typeof (endDate) === 'object' && isNaN(endDate.getTime()))) {
|
|
1031
|
+
endDate = this.globalize.parseDate(this.getAmPmValue(range[1]).trim(), inputFormatOptions);
|
|
1032
|
+
}
|
|
1033
|
+
if (!isNullOrUndefined(startDate) && startDate instanceof Date && !isNaN(startDate.getTime())
|
|
1034
|
+
&& !isNullOrUndefined(endDate) && endDate instanceof Date && !isNaN(endDate.getTime())) {
|
|
1035
|
+
break;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
993
1039
|
if (!isNullOrUndefined(startDate) && !isNaN(+startDate) && !isNullOrUndefined(endDate) && !isNaN(+endDate)) {
|
|
994
1040
|
var prevStartVal = this.startValue;
|
|
995
1041
|
this.startValue = startDate;
|
|
@@ -4430,6 +4476,9 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
4430
4476
|
this.updateInput();
|
|
4431
4477
|
this.changeTrigger();
|
|
4432
4478
|
break;
|
|
4479
|
+
case 'inputFormats':
|
|
4480
|
+
this.checkInputFormats();
|
|
4481
|
+
break;
|
|
4433
4482
|
case 'locale':
|
|
4434
4483
|
this.globalize = new Internationalization(this.locale);
|
|
4435
4484
|
this.l10n.setLocale(this.locale);
|
|
@@ -4695,6 +4744,9 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
4695
4744
|
__decorate([
|
|
4696
4745
|
Property(null)
|
|
4697
4746
|
], DateRangePicker.prototype, "format", void 0);
|
|
4747
|
+
__decorate([
|
|
4748
|
+
Property(null)
|
|
4749
|
+
], DateRangePicker.prototype, "inputFormats", void 0);
|
|
4698
4750
|
__decorate([
|
|
4699
4751
|
Property(true)
|
|
4700
4752
|
], DateRangePicker.prototype, "enabled", void 0);
|
|
@@ -304,6 +304,7 @@ $range-bigger-small-icon-container-min-width: 34px !default;
|
|
|
304
304
|
$range-bigger-small-icon-container-min-height: 34px !default;
|
|
305
305
|
$range-bigger-small-icon-border-radius: 20px !default;
|
|
306
306
|
|
|
307
|
-
.e-bigger.e-daterangepicker .e-calendar.e-week-number
|
|
307
|
+
.e-bigger.e-daterangepicker .e-calendar.e-week-number,
|
|
308
|
+
.e-bigger .e-daterangepicker .e-calendar.e-week-number {
|
|
308
309
|
max-width: 350px;
|
|
309
310
|
}
|
|
@@ -50,7 +50,7 @@ $datetime-list-border-color: 1px solid $border-light !default;
|
|
|
50
50
|
$datetime-list-bg-color: $content-bg-color !default;
|
|
51
51
|
$datetime-list-active-bg-color: $content-bg-color-pressed !default;
|
|
52
52
|
$datetime-list-active-font-color: $content-text-color-pressed !default;
|
|
53
|
-
$datetime-list-active-icon-color: $
|
|
53
|
+
$datetime-list-active-icon-color: $icon-color !default;
|
|
54
54
|
$datetime-list-hover-bg-color: $flyout-bg-color-focus !default;
|
|
55
55
|
$datetime-list-hover-font-color: $content-text-color-hover !default;
|
|
56
56
|
$datetime-list-popup-icon-active-color: $icon-color-pressed !default;
|
|
@@ -340,7 +340,7 @@
|
|
|
340
340
|
|
|
341
341
|
/*! datetimepicker theme */
|
|
342
342
|
.e-datetime-wrapper .e-input-group-icon.e-icons.e-active {
|
|
343
|
-
color: var(--color-sf-
|
|
343
|
+
color: var(--color-sf-icon-color);
|
|
344
344
|
}
|
|
345
345
|
.e-datetime-wrapper.e-input-group:not(.e-disabled) .e-input-group-icon.e-active:active {
|
|
346
346
|
color: var(--color-sf-icon-color-pressed);
|
package/styles/fluent2-lite.css
CHANGED
|
@@ -1617,7 +1617,8 @@ ejs-calendar {
|
|
|
1617
1617
|
color: var(--color-sf-icon-color);
|
|
1618
1618
|
}
|
|
1619
1619
|
|
|
1620
|
-
.e-bigger.e-daterangepicker .e-calendar.e-week-number
|
|
1620
|
+
.e-bigger.e-daterangepicker .e-calendar.e-week-number,
|
|
1621
|
+
.e-bigger .e-daterangepicker .e-calendar.e-week-number {
|
|
1621
1622
|
max-width: 350px;
|
|
1622
1623
|
}
|
|
1623
1624
|
|
|
@@ -2590,7 +2591,7 @@ ejs-calendar {
|
|
|
2590
2591
|
|
|
2591
2592
|
/*! datetimepicker theme */
|
|
2592
2593
|
.e-datetime-wrapper .e-input-group-icon.e-icons.e-active {
|
|
2593
|
-
color: var(--color-sf-
|
|
2594
|
+
color: var(--color-sf-icon-color);
|
|
2594
2595
|
}
|
|
2595
2596
|
.e-datetime-wrapper.e-input-group:not(.e-disabled) .e-input-group-icon.e-active:active {
|
|
2596
2597
|
color: var(--color-sf-icon-color-pressed);
|
package/styles/fluent2.css
CHANGED
|
@@ -2376,7 +2376,8 @@ ejs-calendar {
|
|
|
2376
2376
|
margin: 0;
|
|
2377
2377
|
}
|
|
2378
2378
|
|
|
2379
|
-
.e-bigger.e-daterangepicker .e-calendar.e-week-number
|
|
2379
|
+
.e-bigger.e-daterangepicker .e-calendar.e-week-number,
|
|
2380
|
+
.e-bigger .e-daterangepicker .e-calendar.e-week-number {
|
|
2380
2381
|
max-width: 350px;
|
|
2381
2382
|
}
|
|
2382
2383
|
|
|
@@ -4005,7 +4006,7 @@ ejs-calendar {
|
|
|
4005
4006
|
|
|
4006
4007
|
/*! datetimepicker theme */
|
|
4007
4008
|
.e-datetime-wrapper .e-input-group-icon.e-icons.e-active {
|
|
4008
|
-
color: var(--color-sf-
|
|
4009
|
+
color: var(--color-sf-icon-color);
|
|
4009
4010
|
}
|
|
4010
4011
|
.e-datetime-wrapper.e-input-group:not(.e-disabled) .e-input-group-icon.e-active:active {
|
|
4011
4012
|
color: var(--color-sf-icon-color-pressed);
|
package/styles/tailwind3.css
CHANGED