@progress/kendo-dateinputs-common 0.4.2-dev.202501141100 → 0.4.2-develop.2
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/dist/cdn/js/kendo-dateinputs-common.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/dateobject.js +15 -9
- package/dist/es/common/observable.js +1 -0
- package/dist/es/common/utils.js +4 -2
- package/dist/es/dateinput/dateinput.js +12 -10
- package/dist/es2015/common/dateobject.js +56 -50
- package/dist/es2015/common/observable.js +2 -1
- package/dist/es2015/common/utils.js +2 -1
- package/dist/es2015/dateinput/dateinput.js +11 -9
- package/dist/npm/common/constants.js +1 -0
- package/dist/npm/common/dateobject.d.ts +3 -2
- package/dist/npm/common/dateobject.js +117 -110
- package/dist/npm/common/key.js +1 -0
- package/dist/npm/common/keycode.js +1 -0
- package/dist/npm/common/mask.js +1 -0
- package/dist/npm/common/observable.js +5 -3
- package/dist/npm/common/utils.d.ts +1 -1
- package/dist/npm/common/utils.js +42 -23
- package/dist/npm/dateinput/dateinput.d.ts +7 -7
- package/dist/npm/dateinput/dateinput.js +43 -40
- package/dist/npm/dateinput/interaction-mode.js +2 -1
- package/dist/npm/dateinput/utils.js +11 -5
- package/dist/npm/main.js +2 -1
- package/dist/systemjs/kendo-dateinputs-common.js +1 -1
- package/package.json +40 -47
- package/CODEOWNERS +0 -2
- package/NOTICE.txt +0 -614
- package/bin/release-master +0 -20
- package/global-setup.js +0 -4
- package/jest.config.js +0 -9
- package/tools/release-master +0 -20
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateObject = void 0;
|
|
3
4
|
var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
4
5
|
var mask_1 = require("./mask");
|
|
5
6
|
var utils_1 = require("../dateinput/utils");
|
|
@@ -75,7 +76,7 @@ var DateObject = /** @class */ (function () {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
else {
|
|
78
|
-
this._value = kendo_date_math_1.cloneDate(value);
|
|
79
|
+
this._value = (0, kendo_date_math_1.cloneDate)(value);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
Object.defineProperty(DateObject.prototype, "value", {
|
|
@@ -90,7 +91,7 @@ var DateObject = /** @class */ (function () {
|
|
|
90
91
|
this._value = value;
|
|
91
92
|
this.resetInvalidDate();
|
|
92
93
|
},
|
|
93
|
-
enumerable:
|
|
94
|
+
enumerable: false,
|
|
94
95
|
configurable: true
|
|
95
96
|
});
|
|
96
97
|
Object.defineProperty(DateObject.prototype, "localeId", {
|
|
@@ -108,7 +109,7 @@ var DateObject = /** @class */ (function () {
|
|
|
108
109
|
}
|
|
109
110
|
return localeId;
|
|
110
111
|
},
|
|
111
|
-
enumerable:
|
|
112
|
+
enumerable: false,
|
|
112
113
|
configurable: true
|
|
113
114
|
});
|
|
114
115
|
/**
|
|
@@ -130,8 +131,8 @@ var DateObject = /** @class */ (function () {
|
|
|
130
131
|
this._value = this.getDefaultDate();
|
|
131
132
|
this.modifyExisting(false);
|
|
132
133
|
}
|
|
133
|
-
else if (!kendo_date_math_1.isEqual(value, this._value)) {
|
|
134
|
-
this._value = kendo_date_math_1.cloneDate(value);
|
|
134
|
+
else if (!(0, kendo_date_math_1.isEqual)(value, this._value)) {
|
|
135
|
+
this._value = (0, kendo_date_math_1.cloneDate)(value);
|
|
135
136
|
this.modifyExisting(true);
|
|
136
137
|
}
|
|
137
138
|
this.resetInvalidDate();
|
|
@@ -153,7 +154,7 @@ var DateObject = /** @class */ (function () {
|
|
|
153
154
|
return null;
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
|
-
return kendo_date_math_1.cloneDate(this.value);
|
|
157
|
+
return (0, kendo_date_math_1.cloneDate)(this.value);
|
|
157
158
|
};
|
|
158
159
|
/**
|
|
159
160
|
* @hidden
|
|
@@ -164,13 +165,13 @@ var DateObject = /** @class */ (function () {
|
|
|
164
165
|
// so that the default date can accommodate maximum date values
|
|
165
166
|
// it is better to use a fixed date instead of new Date()
|
|
166
167
|
// as otherwise the
|
|
167
|
-
return kendo_date_math_1.createDate(DEFAULT_LEAP_YEAR, 0, 31);
|
|
168
|
+
return (0, kendo_date_math_1.createDate)(DEFAULT_LEAP_YEAR, 0, 31);
|
|
168
169
|
};
|
|
169
170
|
/**
|
|
170
171
|
* @hidden
|
|
171
172
|
*/
|
|
172
173
|
DateObject.prototype.getDefaultDate = function () {
|
|
173
|
-
return kendo_date_math_1.getDate(this.createDefaultDate());
|
|
174
|
+
return (0, kendo_date_math_1.getDate)(this.createDefaultDate());
|
|
174
175
|
};
|
|
175
176
|
/**
|
|
176
177
|
* @hidden
|
|
@@ -198,13 +199,13 @@ var DateObject = /** @class */ (function () {
|
|
|
198
199
|
else if (this.getInvalidDatePartValue(symbol)) {
|
|
199
200
|
var partsForSegment = this.getPartsForSegment(mask, i);
|
|
200
201
|
if (symbol === "M") {
|
|
201
|
-
var datePartText = (utils_2.parseToInt(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();
|
|
202
|
+
var datePartText = ((0, utils_2.parseToInt)(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();
|
|
202
203
|
if (partsForSegment.length > MONTH_PART_WITH_WORDS_THRESHOLD) {
|
|
203
204
|
partiallyInvalidText += formattedDates[symbol][i];
|
|
204
205
|
}
|
|
205
206
|
else {
|
|
206
207
|
if (this.getInvalidDatePartValue(symbol)) {
|
|
207
|
-
var formattedDatePart = utils_1.padZero(partsForSegment.length - datePartText.length) + datePartText;
|
|
208
|
+
var formattedDatePart = (0, utils_1.padZero)(partsForSegment.length - datePartText.length) + datePartText;
|
|
208
209
|
partiallyInvalidText += formattedDatePart;
|
|
209
210
|
// add -1 as the first character in the segment is at index i
|
|
210
211
|
i += partsForSegment.length - 1;
|
|
@@ -217,7 +218,7 @@ var DateObject = /** @class */ (function () {
|
|
|
217
218
|
else {
|
|
218
219
|
if (this.getInvalidDatePartValue(symbol)) {
|
|
219
220
|
var datePartText = this.getInvalidDatePartValue(symbol).toString();
|
|
220
|
-
var formattedDatePart = utils_1.padZero(partsForSegment.length - datePartText.length) + datePartText;
|
|
221
|
+
var formattedDatePart = (0, utils_1.padZero)(partsForSegment.length - datePartText.length) + datePartText;
|
|
221
222
|
partiallyInvalidText += formattedDatePart;
|
|
222
223
|
// add -1 as the first character in the segment is at index i
|
|
223
224
|
i += partsForSegment.length - 1;
|
|
@@ -337,10 +338,10 @@ var DateObject = /** @class */ (function () {
|
|
|
337
338
|
}
|
|
338
339
|
};
|
|
339
340
|
DateObject.prototype.modifyPart = function (symbol, offset) {
|
|
340
|
-
if (!utils_2.isPresent(symbol) || !utils_2.isPresent(offset) || offset === 0) {
|
|
341
|
+
if (!(0, utils_2.isPresent)(symbol) || !(0, utils_2.isPresent)(offset) || offset === 0) {
|
|
341
342
|
return;
|
|
342
343
|
}
|
|
343
|
-
var newValue = kendo_date_math_1.cloneDate(this.value);
|
|
344
|
+
var newValue = (0, kendo_date_math_1.cloneDate)(this.value);
|
|
344
345
|
var timeModified = false;
|
|
345
346
|
var invalidDateFound;
|
|
346
347
|
var isMonth = symbol === "M";
|
|
@@ -384,17 +385,17 @@ var DateObject = /** @class */ (function () {
|
|
|
384
385
|
}
|
|
385
386
|
if (!symbolExists) {
|
|
386
387
|
if (month < 0) {
|
|
387
|
-
month = utils_2.clamp(11 + ((month % 11) + 1), 0, 11);
|
|
388
|
+
month = (0, utils_2.clamp)(11 + ((month % 11) + 1), 0, 11);
|
|
388
389
|
}
|
|
389
390
|
else {
|
|
390
|
-
var monthValue = utils_2.isPresent(invalidDatePartValue) ?
|
|
391
|
+
var monthValue = (0, utils_2.isPresent)(invalidDatePartValue) ?
|
|
391
392
|
month :
|
|
392
393
|
((offset - JS_MONTH_OFFSET) % 12);
|
|
393
|
-
month = utils_2.clamp(monthValue, 0, 11);
|
|
394
|
+
month = (0, utils_2.clamp)(monthValue, 0, 11);
|
|
394
395
|
}
|
|
395
|
-
month = utils_2.clamp(month, 0, 11);
|
|
396
|
+
month = (0, utils_2.clamp)(month, 0, 11);
|
|
396
397
|
}
|
|
397
|
-
month = utils_2.clamp(month, 0, 11);
|
|
398
|
+
month = (0, utils_2.clamp)(month, 0, 11);
|
|
398
399
|
}
|
|
399
400
|
else if (symbol === "d") {
|
|
400
401
|
if (symbolExists) {
|
|
@@ -405,7 +406,7 @@ var DateObject = /** @class */ (function () {
|
|
|
405
406
|
}
|
|
406
407
|
}
|
|
407
408
|
else if (!symbolExists) {
|
|
408
|
-
if (utils_2.isPresent(invalidDatePartValue)) {
|
|
409
|
+
if ((0, utils_2.isPresent)(invalidDatePartValue)) {
|
|
409
410
|
if (day <= 0 || day > 31) {
|
|
410
411
|
this.setExisting(symbol, false);
|
|
411
412
|
this.resetInvalidDateSymbol(symbol);
|
|
@@ -413,46 +414,46 @@ var DateObject = /** @class */ (function () {
|
|
|
413
414
|
}
|
|
414
415
|
}
|
|
415
416
|
if (offset < 0) {
|
|
416
|
-
var dayValue = utils_2.isPresent(invalidDatePartValue) ? day : 1 + (31 - Math.abs(offset % 31));
|
|
417
|
-
day = utils_2.clamp(dayValue, 1, 31);
|
|
417
|
+
var dayValue = (0, utils_2.isPresent)(invalidDatePartValue) ? day : 1 + (31 - Math.abs(offset % 31));
|
|
418
|
+
day = (0, utils_2.clamp)(dayValue, 1, 31);
|
|
418
419
|
}
|
|
419
420
|
else {
|
|
420
|
-
var dayValue = utils_2.isPresent(invalidDatePartValue) ? day : offset % 31;
|
|
421
|
-
day = utils_2.clamp(dayValue, 1, 31);
|
|
421
|
+
var dayValue = (0, utils_2.isPresent)(invalidDatePartValue) ? day : offset % 31;
|
|
422
|
+
day = (0, utils_2.clamp)(dayValue, 1, 31);
|
|
422
423
|
}
|
|
423
|
-
day = utils_2.clamp(day, 1, 31);
|
|
424
|
+
day = (0, utils_2.clamp)(day, 1, 31);
|
|
424
425
|
}
|
|
425
426
|
}
|
|
426
|
-
var dateCandidate = kendo_date_math_1.createDate(year, month, day, hour, minutes, seconds, milliseconds);
|
|
427
|
+
var dateCandidate = (0, kendo_date_math_1.createDate)(year, month, day, hour, minutes, seconds, milliseconds);
|
|
427
428
|
var newValueCandidate = isMonth || isDay ?
|
|
428
429
|
this.modifyDateSymbolWithValue(newValue, symbol, isMonth ? month : day) :
|
|
429
430
|
null;
|
|
430
|
-
var dateCandidateExists = utils_2.areDatePartsEqualTo(dateCandidate, year, month, day, hour, minutes, seconds, milliseconds);
|
|
431
|
-
if (this.getValue() && utils_2.areDatePartsEqualTo(dateCandidate, year, month, day, hour, minutes, seconds, milliseconds)) {
|
|
432
|
-
newValue = kendo_date_math_1.cloneDate(dateCandidate);
|
|
431
|
+
var dateCandidateExists = (0, utils_2.areDatePartsEqualTo)(dateCandidate, year, month, day, hour, minutes, seconds, milliseconds);
|
|
432
|
+
if (this.getValue() && (0, utils_2.areDatePartsEqualTo)(dateCandidate, year, month, day, hour, minutes, seconds, milliseconds)) {
|
|
433
|
+
newValue = (0, kendo_date_math_1.cloneDate)(dateCandidate);
|
|
433
434
|
this.markDatePartsAsExisting();
|
|
434
435
|
}
|
|
435
436
|
else if (isMonth && newValueCandidate) {
|
|
436
437
|
if (newValueCandidate.getMonth() === month) {
|
|
437
438
|
if (this.getExisting("d")) {
|
|
438
439
|
if (dateCandidateExists) {
|
|
439
|
-
newValue = kendo_date_math_1.cloneDate(dateCandidate);
|
|
440
|
+
newValue = (0, kendo_date_math_1.cloneDate)(dateCandidate);
|
|
440
441
|
this.resetInvalidDateSymbol(symbol);
|
|
441
442
|
}
|
|
442
443
|
else {
|
|
443
444
|
invalidDateFound = true;
|
|
444
445
|
this.setInvalidDatePart(symbol, {
|
|
445
446
|
value: month,
|
|
446
|
-
date: kendo_date_math_1.cloneDate(newValueCandidate),
|
|
447
|
+
date: (0, kendo_date_math_1.cloneDate)(newValueCandidate),
|
|
447
448
|
startDateOffset: offset,
|
|
448
|
-
startDate: kendo_date_math_1.cloneDate(this.value)
|
|
449
|
+
startDate: (0, kendo_date_math_1.cloneDate)(this.value)
|
|
449
450
|
});
|
|
450
451
|
this.setExisting(symbol, false);
|
|
451
452
|
}
|
|
452
453
|
}
|
|
453
454
|
else if (dateCandidateExists) {
|
|
454
455
|
this.resetInvalidDateSymbol(symbol);
|
|
455
|
-
newValue = kendo_date_math_1.cloneDate(dateCandidate);
|
|
456
|
+
newValue = (0, kendo_date_math_1.cloneDate)(dateCandidate);
|
|
456
457
|
if (this.getExisting("M") && this.getExisting("y")) {
|
|
457
458
|
// changing from 28/Feb to 29/Feb to 29/March
|
|
458
459
|
this.setExisting("d", true);
|
|
@@ -461,16 +462,16 @@ var DateObject = /** @class */ (function () {
|
|
|
461
462
|
}
|
|
462
463
|
else {
|
|
463
464
|
this.resetInvalidDateSymbol(symbol);
|
|
464
|
-
newValue = kendo_date_math_1.cloneDate(newValueCandidate);
|
|
465
|
+
newValue = (0, kendo_date_math_1.cloneDate)(newValueCandidate);
|
|
465
466
|
}
|
|
466
467
|
}
|
|
467
468
|
else {
|
|
468
469
|
invalidDateFound = true;
|
|
469
470
|
this.setInvalidDatePart(symbol, {
|
|
470
471
|
value: month,
|
|
471
|
-
date: kendo_date_math_1.cloneDate(newValueCandidate),
|
|
472
|
+
date: (0, kendo_date_math_1.cloneDate)(newValueCandidate),
|
|
472
473
|
startDateOffset: offset,
|
|
473
|
-
startDate: kendo_date_math_1.cloneDate(this.value)
|
|
474
|
+
startDate: (0, kendo_date_math_1.cloneDate)(this.value)
|
|
474
475
|
});
|
|
475
476
|
this.setExisting(symbol, false);
|
|
476
477
|
}
|
|
@@ -479,22 +480,22 @@ var DateObject = /** @class */ (function () {
|
|
|
479
480
|
if (newValueCandidate.getDate() === day) {
|
|
480
481
|
if (this.getExisting("M")) {
|
|
481
482
|
if (dateCandidateExists) {
|
|
482
|
-
newValue = kendo_date_math_1.cloneDate(dateCandidate);
|
|
483
|
+
newValue = (0, kendo_date_math_1.cloneDate)(dateCandidate);
|
|
483
484
|
this.resetInvalidDateSymbol(symbol);
|
|
484
485
|
}
|
|
485
486
|
else {
|
|
486
487
|
invalidDateFound = true;
|
|
487
488
|
this.setInvalidDatePart(symbol, {
|
|
488
489
|
value: day,
|
|
489
|
-
date: kendo_date_math_1.cloneDate(newValueCandidate),
|
|
490
|
+
date: (0, kendo_date_math_1.cloneDate)(newValueCandidate),
|
|
490
491
|
startDateOffset: offset,
|
|
491
|
-
startDate: kendo_date_math_1.cloneDate(this.value)
|
|
492
|
+
startDate: (0, kendo_date_math_1.cloneDate)(this.value)
|
|
492
493
|
});
|
|
493
494
|
this.setExisting(symbol, false);
|
|
494
495
|
}
|
|
495
496
|
}
|
|
496
497
|
else if (dateCandidateExists) {
|
|
497
|
-
newValue = kendo_date_math_1.cloneDate(dateCandidate);
|
|
498
|
+
newValue = (0, kendo_date_math_1.cloneDate)(dateCandidate);
|
|
498
499
|
this.resetInvalidDateSymbol(symbol);
|
|
499
500
|
if (this.getExisting("d") && this.getExisting("y")) {
|
|
500
501
|
// changing from 31/Jan to 31/Feb to 28/Feb
|
|
@@ -504,28 +505,29 @@ var DateObject = /** @class */ (function () {
|
|
|
504
505
|
}
|
|
505
506
|
else {
|
|
506
507
|
this.resetInvalidDateSymbol(symbol);
|
|
507
|
-
newValue = kendo_date_math_1.cloneDate(newValueCandidate);
|
|
508
|
+
newValue = (0, kendo_date_math_1.cloneDate)(newValueCandidate);
|
|
508
509
|
}
|
|
509
510
|
}
|
|
510
511
|
else {
|
|
511
512
|
invalidDateFound = true;
|
|
512
513
|
this.setInvalidDatePart(symbol, {
|
|
513
514
|
value: day,
|
|
514
|
-
date: kendo_date_math_1.cloneDate(this.value),
|
|
515
|
+
date: (0, kendo_date_math_1.cloneDate)(this.value),
|
|
515
516
|
startDateOffset: offset,
|
|
516
|
-
startDate: kendo_date_math_1.cloneDate(this.value)
|
|
517
|
+
startDate: (0, kendo_date_math_1.cloneDate)(this.value)
|
|
517
518
|
});
|
|
518
519
|
this.setExisting(symbol, false);
|
|
519
520
|
}
|
|
520
521
|
}
|
|
521
522
|
}
|
|
522
523
|
else {
|
|
524
|
+
var hours = newValue.getHours();
|
|
523
525
|
switch (symbol) {
|
|
524
526
|
case 'y':
|
|
525
527
|
newValue.setFullYear(newValue.getFullYear() + offset);
|
|
526
528
|
break;
|
|
527
529
|
case 'M':
|
|
528
|
-
newValue = kendo_date_math_1.addMonths(this.value, offset);
|
|
530
|
+
newValue = (0, kendo_date_math_1.addMonths)(this.value, offset);
|
|
529
531
|
break;
|
|
530
532
|
case 'd':
|
|
531
533
|
case 'E':
|
|
@@ -548,7 +550,6 @@ var DateObject = /** @class */ (function () {
|
|
|
548
550
|
newValue.setMilliseconds(newValue.getMilliseconds() + offset);
|
|
549
551
|
break;
|
|
550
552
|
case 'a':
|
|
551
|
-
var hours = newValue.getHours();
|
|
552
553
|
if (this.toggleDayPeriod) {
|
|
553
554
|
newValue.setHours(hours >= 12 ? hours - 12 : hours + 12);
|
|
554
555
|
}
|
|
@@ -640,7 +641,7 @@ var DateObject = /** @class */ (function () {
|
|
|
640
641
|
this.resetLeadingZero();
|
|
641
642
|
this.setExisting(symbol, false);
|
|
642
643
|
this.resetInvalidDateSymbol(symbol);
|
|
643
|
-
return utils_2.extend(parseResult, { value: null, switchToNext: false });
|
|
644
|
+
return (0, utils_2.extend)(parseResult, { value: null, switchToNext: false });
|
|
644
645
|
}
|
|
645
646
|
}
|
|
646
647
|
}
|
|
@@ -648,7 +649,7 @@ var DateObject = /** @class */ (function () {
|
|
|
648
649
|
this.resetLeadingZero();
|
|
649
650
|
this.setExisting(symbol, false);
|
|
650
651
|
this.resetInvalidDateSymbol(symbol);
|
|
651
|
-
return utils_2.extend(parseResult, { value: null, switchToNext: false });
|
|
652
|
+
return (0, utils_2.extend)(parseResult, { value: null, switchToNext: false });
|
|
652
653
|
}
|
|
653
654
|
}
|
|
654
655
|
var baseDate = this.intl.formatDate(this.value, this.format, this.localeId);
|
|
@@ -704,7 +705,7 @@ var DateObject = /** @class */ (function () {
|
|
|
704
705
|
// let the parsing to determine if the incomplete value is valid
|
|
705
706
|
}
|
|
706
707
|
if (datePartText.length > segmentLength) {
|
|
707
|
-
return utils_2.extend(parseResult, { value: null, switchToNext: false });
|
|
708
|
+
return (0, utils_2.extend)(parseResult, { value: null, switchToNext: false });
|
|
708
709
|
}
|
|
709
710
|
}
|
|
710
711
|
if (!hasFixedFormat || (hasFixedFormat && !this.autoCorrectParts)) {
|
|
@@ -773,7 +774,7 @@ var DateObject = /** @class */ (function () {
|
|
|
773
774
|
if (datePartText === "0") {
|
|
774
775
|
datePartText = current;
|
|
775
776
|
}
|
|
776
|
-
var valueNumber = utils_2.parseToInt(resetSegmentValue ?
|
|
777
|
+
var valueNumber = (0, utils_2.parseToInt)(resetSegmentValue ?
|
|
777
778
|
currentChar :
|
|
778
779
|
(isInCaretMode ? datePartText : current) + currentChar);
|
|
779
780
|
if (valueNumber === 0 && !this.isAbbrMonth(dateParts.partMap, symbol)) {
|
|
@@ -789,7 +790,7 @@ var DateObject = /** @class */ (function () {
|
|
|
789
790
|
if (isInCaretMode) {
|
|
790
791
|
if (isDeleting && !datePartText) {
|
|
791
792
|
this.setExisting(symbol, false);
|
|
792
|
-
return utils_2.extend(parseResult, { value: null, switchToNext: false });
|
|
793
|
+
return (0, utils_2.extend)(parseResult, { value: null, switchToNext: false });
|
|
793
794
|
}
|
|
794
795
|
}
|
|
795
796
|
var currentMaxLength = current.length - 3;
|
|
@@ -806,15 +807,25 @@ var DateObject = /** @class */ (function () {
|
|
|
806
807
|
(current.substring(i) + currentChar);
|
|
807
808
|
if (isInCaretMode || !this.autoCorrectParts) {
|
|
808
809
|
tryParse = false;
|
|
809
|
-
middle = utils_1.unpadZero(middle);
|
|
810
|
+
middle = (0, utils_1.unpadZero)(middle);
|
|
810
811
|
// middle = padZero(segmentLength - middle.length) + middle;
|
|
811
|
-
middle = utils_1.padZero(patternLength - middle.length) + middle;
|
|
812
|
+
middle = (0, utils_1.padZero)(patternLength - middle.length) + middle;
|
|
812
813
|
}
|
|
813
814
|
var middleNumber = parseInt(middle, 10);
|
|
814
815
|
var candidateDateString = prefix + middle + suffix;
|
|
815
816
|
parsedDate = this.intl.parseDate(candidateDateString, this.format, this.localeId);
|
|
817
|
+
// if the format does not include year/month/day, e.g. hh:mm:ss
|
|
818
|
+
// then the exact date cannot be inferred as there is no data for it
|
|
819
|
+
// thus the today's date is used, but revert to the original date
|
|
820
|
+
// to keep other parts of the date unchanged
|
|
821
|
+
if (parsedDate && this.value &&
|
|
822
|
+
dateParts.partMap.every(function (x) { return x.type !== "year" && x.type !== "month" && x.type != "day"; })) {
|
|
823
|
+
parsedDate.setFullYear(this.value.getFullYear());
|
|
824
|
+
parsedDate.setMonth(this.value.getMonth());
|
|
825
|
+
parsedDate.setDate(this.value.getDate());
|
|
826
|
+
}
|
|
816
827
|
var autoCorrectedPrefixAndSuffix = false;
|
|
817
|
-
if (isInCaretMode && !utils_2.isValidDate(parsedDate)) {
|
|
828
|
+
if (isInCaretMode && !(0, utils_2.isValidDate)(parsedDate)) {
|
|
818
829
|
// if part of the date is not available, e.g. "d"
|
|
819
830
|
// but an expanded format like "F" is used
|
|
820
831
|
// the element value can be "EEEE, February 1, 2022 3:04:05 AM"
|
|
@@ -833,22 +844,22 @@ var DateObject = /** @class */ (function () {
|
|
|
833
844
|
// JS months start from 0 (January) instead of 1 (January)
|
|
834
845
|
var monthNumber = middleNumber - JS_MONTH_OFFSET;
|
|
835
846
|
if (monthNumber > -1 && monthNumber < 12) {
|
|
836
|
-
parsedDate = kendo_date_math_1.cloneDate(this.value);
|
|
847
|
+
parsedDate = (0, kendo_date_math_1.cloneDate)(this.value);
|
|
837
848
|
parsedDate.setMonth(monthNumber);
|
|
838
849
|
if (parsedDate.getMonth() !== monthNumber) {
|
|
839
|
-
parsedDate = kendo_date_math_1.lastDayOfMonth(kendo_date_math_1.addMonths(parsedDate, -1));
|
|
850
|
+
parsedDate = (0, kendo_date_math_1.lastDayOfMonth)((0, kendo_date_math_1.addMonths)(parsedDate, -1));
|
|
840
851
|
}
|
|
841
852
|
}
|
|
842
853
|
}
|
|
843
854
|
if (symbol === 'y') {
|
|
844
|
-
parsedDate = kendo_date_math_1.createDate(parseInt(middle, 10), this.month ? this.value.getMonth() : 0, this.date ? this.value.getDate() : 1, this.hours ? this.value.getHours() : 0, this.minutes ? this.value.getMinutes() : 0, this.seconds ? this.value.getSeconds() : 0, this.milliseconds ? this.value.getMilliseconds() : 0);
|
|
845
|
-
if (((isInCaretMode && utils_2.isValidDate(parsedDate)) ||
|
|
855
|
+
parsedDate = (0, kendo_date_math_1.createDate)(parseInt(middle, 10), this.month ? this.value.getMonth() : 0, this.date ? this.value.getDate() : 1, this.hours ? this.value.getHours() : 0, this.minutes ? this.value.getMinutes() : 0, this.seconds ? this.value.getSeconds() : 0, this.milliseconds ? this.value.getMilliseconds() : 0);
|
|
856
|
+
if (((isInCaretMode && (0, utils_2.isValidDate)(parsedDate)) ||
|
|
846
857
|
(!isInCaretMode && parsedDate)) && this.date && parsedDate.getDate() !== this.value.getDate()) {
|
|
847
|
-
parsedDate = kendo_date_math_1.lastDayOfMonth(kendo_date_math_1.addMonths(parsedDate, -1));
|
|
858
|
+
parsedDate = (0, kendo_date_math_1.lastDayOfMonth)((0, kendo_date_math_1.addMonths)(parsedDate, -1));
|
|
848
859
|
}
|
|
849
860
|
}
|
|
850
861
|
}
|
|
851
|
-
if ((isInCaretMode && utils_2.isValidDate(parsedDate)) || (!isInCaretMode && parsedDate)) {
|
|
862
|
+
if ((isInCaretMode && (0, utils_2.isValidDate)(parsedDate)) || (!isInCaretMode && parsedDate)) {
|
|
852
863
|
// move to next segment if the part will overflow with next char
|
|
853
864
|
// when start from empty date (01, then 010), padded zeros should be trimmed
|
|
854
865
|
var peekResult = this.isPeekDateOverflowingDatePart({
|
|
@@ -907,7 +918,7 @@ var DateObject = /** @class */ (function () {
|
|
|
907
918
|
}
|
|
908
919
|
}
|
|
909
920
|
}
|
|
910
|
-
return utils_2.extend(parseResult, { value: this.value, switchToNext: switchToNext });
|
|
921
|
+
return (0, utils_2.extend)(parseResult, { value: this.value, switchToNext: switchToNext });
|
|
911
922
|
}
|
|
912
923
|
}
|
|
913
924
|
if (month) {
|
|
@@ -915,7 +926,7 @@ var DateObject = /** @class */ (function () {
|
|
|
915
926
|
if (parsedDate) {
|
|
916
927
|
this._value = parsedDate;
|
|
917
928
|
this.setExisting(symbol, true);
|
|
918
|
-
return utils_2.extend(parseResult, { value: this.value, switchToNext: false });
|
|
929
|
+
return (0, utils_2.extend)(parseResult, { value: this.value, switchToNext: false });
|
|
919
930
|
}
|
|
920
931
|
}
|
|
921
932
|
if (dayPeriod) {
|
|
@@ -924,7 +935,7 @@ var DateObject = /** @class */ (function () {
|
|
|
924
935
|
if (parsedDate) {
|
|
925
936
|
this._value = parsedDate;
|
|
926
937
|
this.setExisting(symbol, true);
|
|
927
|
-
return utils_2.extend(parseResult, { value: this.value, switchToNext: true });
|
|
938
|
+
return (0, utils_2.extend)(parseResult, { value: this.value, switchToNext: true });
|
|
928
939
|
}
|
|
929
940
|
}
|
|
930
941
|
if (isZeroCurrentChar) {
|
|
@@ -933,12 +944,12 @@ var DateObject = /** @class */ (function () {
|
|
|
933
944
|
if (!this.autoCorrectParts) {
|
|
934
945
|
var datePartValue = void 0;
|
|
935
946
|
var textToParse = isInCaretMode ? datePartText : middle;
|
|
936
|
-
var parsedValue = utils_2.parseToInt(textToParse);
|
|
937
|
-
if (utils_2.isNumber(parsedValue) && utils_2.isParseableToInt(textToParse)) {
|
|
947
|
+
var parsedValue = (0, utils_2.parseToInt)(textToParse);
|
|
948
|
+
if ((0, utils_2.isNumber)(parsedValue) && (0, utils_2.isParseableToInt)(textToParse)) {
|
|
938
949
|
if ((symbol === "d" && (parsedValue <= 0 || parsedValue > 31)) ||
|
|
939
950
|
(symbol === "M" && (parsedValue <= 0 || parsedValue > 11))) {
|
|
940
951
|
if (isInCaretMode) {
|
|
941
|
-
return utils_2.extend(parseResult, {
|
|
952
|
+
return (0, utils_2.extend)(parseResult, {
|
|
942
953
|
value: null,
|
|
943
954
|
switchToNext: false
|
|
944
955
|
});
|
|
@@ -949,18 +960,18 @@ var DateObject = /** @class */ (function () {
|
|
|
949
960
|
// otherwise the input is ignored and you cannot change the value,
|
|
950
961
|
// e.g. "03->(press 2)->02" will not work and the user will be blocked on "03"
|
|
951
962
|
textToParse = currentChar;
|
|
952
|
-
parsedValue = utils_2.parseToInt(textToParse);
|
|
963
|
+
parsedValue = (0, utils_2.parseToInt)(textToParse);
|
|
953
964
|
}
|
|
954
965
|
}
|
|
955
|
-
if (!utils_2.isNumber(parsedValue) || !utils_2.isParseableToInt(textToParse)) {
|
|
956
|
-
return utils_2.extend(parseResult, { value: null, switchToNext: false });
|
|
966
|
+
if (!(0, utils_2.isNumber)(parsedValue) || !(0, utils_2.isParseableToInt)(textToParse)) {
|
|
967
|
+
return (0, utils_2.extend)(parseResult, { value: null, switchToNext: false });
|
|
957
968
|
}
|
|
958
969
|
datePartValue = symbol === "M" ?
|
|
959
970
|
parsedValue - JS_MONTH_OFFSET :
|
|
960
971
|
parsedValue;
|
|
961
972
|
var isMonth = symbol === "M";
|
|
962
973
|
var isDay = symbol === "d";
|
|
963
|
-
var newValue = kendo_date_math_1.cloneDate(this._value);
|
|
974
|
+
var newValue = (0, kendo_date_math_1.cloneDate)(this._value);
|
|
964
975
|
var invalidDateParts = this._partiallyInvalidDate.invalidDateParts || {};
|
|
965
976
|
var year = invalidDateParts.y.value || newValue.getFullYear();
|
|
966
977
|
/* tslint:disable:no-shadowed-variable */
|
|
@@ -971,8 +982,8 @@ var DateObject = /** @class */ (function () {
|
|
|
971
982
|
var minutes = invalidDateParts.m.value || newValue.getMinutes();
|
|
972
983
|
var seconds = invalidDateParts.s.value || newValue.getSeconds();
|
|
973
984
|
var milliseconds = invalidDateParts.S.value || newValue.getMilliseconds();
|
|
974
|
-
var dateCandidate = kendo_date_math_1.createDate(year, month_1, day, hour, minutes, seconds, milliseconds);
|
|
975
|
-
var dateCandidateExists = utils_2.areDatePartsEqualTo(dateCandidate, year, month_1, day, hour, minutes, seconds, milliseconds);
|
|
985
|
+
var dateCandidate = (0, kendo_date_math_1.createDate)(year, month_1, day, hour, minutes, seconds, milliseconds);
|
|
986
|
+
var dateCandidateExists = (0, utils_2.areDatePartsEqualTo)(dateCandidate, year, month_1, day, hour, minutes, seconds, milliseconds);
|
|
976
987
|
var newValueCandidate = isMonth || isDay ?
|
|
977
988
|
this.modifyDateSymbolWithValue(newValue, symbol, isMonth ? month_1 : day) :
|
|
978
989
|
null;
|
|
@@ -981,22 +992,22 @@ var DateObject = /** @class */ (function () {
|
|
|
981
992
|
if (newValueCandidate.getMonth() === month_1) {
|
|
982
993
|
if (this.getExisting("d")) {
|
|
983
994
|
if (dateCandidateExists) {
|
|
984
|
-
newValue = kendo_date_math_1.cloneDate(dateCandidate);
|
|
995
|
+
newValue = (0, kendo_date_math_1.cloneDate)(dateCandidate);
|
|
985
996
|
this.resetInvalidDateSymbol(symbol);
|
|
986
997
|
}
|
|
987
998
|
else {
|
|
988
999
|
invalidDateFound = true;
|
|
989
1000
|
this.setInvalidDatePart(symbol, {
|
|
990
1001
|
value: month_1,
|
|
991
|
-
date: kendo_date_math_1.cloneDate(newValueCandidate),
|
|
992
|
-
startDate: kendo_date_math_1.cloneDate(this.value)
|
|
1002
|
+
date: (0, kendo_date_math_1.cloneDate)(newValueCandidate),
|
|
1003
|
+
startDate: (0, kendo_date_math_1.cloneDate)(this.value)
|
|
993
1004
|
});
|
|
994
1005
|
this.setExisting(symbol, false);
|
|
995
1006
|
}
|
|
996
1007
|
}
|
|
997
1008
|
else if (dateCandidateExists) {
|
|
998
1009
|
this.resetInvalidDateSymbol(symbol);
|
|
999
|
-
newValue = kendo_date_math_1.cloneDate(dateCandidate);
|
|
1010
|
+
newValue = (0, kendo_date_math_1.cloneDate)(dateCandidate);
|
|
1000
1011
|
if (this.getExisting("M") && this.getExisting("y")) {
|
|
1001
1012
|
// changing from 28/Feb to 29/Feb to 29/March
|
|
1002
1013
|
this.setExisting("d", true);
|
|
@@ -1005,15 +1016,15 @@ var DateObject = /** @class */ (function () {
|
|
|
1005
1016
|
}
|
|
1006
1017
|
else {
|
|
1007
1018
|
this.resetInvalidDateSymbol(symbol);
|
|
1008
|
-
newValue = kendo_date_math_1.cloneDate(newValueCandidate);
|
|
1019
|
+
newValue = (0, kendo_date_math_1.cloneDate)(newValueCandidate);
|
|
1009
1020
|
}
|
|
1010
1021
|
}
|
|
1011
1022
|
else {
|
|
1012
1023
|
invalidDateFound = true;
|
|
1013
1024
|
this.setInvalidDatePart(symbol, {
|
|
1014
1025
|
value: month_1,
|
|
1015
|
-
date: kendo_date_math_1.cloneDate(newValueCandidate),
|
|
1016
|
-
startDate: kendo_date_math_1.cloneDate(this.value)
|
|
1026
|
+
date: (0, kendo_date_math_1.cloneDate)(newValueCandidate),
|
|
1027
|
+
startDate: (0, kendo_date_math_1.cloneDate)(this.value)
|
|
1017
1028
|
});
|
|
1018
1029
|
this.setExisting(symbol, false);
|
|
1019
1030
|
}
|
|
@@ -1022,21 +1033,21 @@ var DateObject = /** @class */ (function () {
|
|
|
1022
1033
|
if (newValueCandidate.getDate() === day) {
|
|
1023
1034
|
if (this.getExisting("M")) {
|
|
1024
1035
|
if (dateCandidateExists) {
|
|
1025
|
-
newValue = kendo_date_math_1.cloneDate(dateCandidate);
|
|
1036
|
+
newValue = (0, kendo_date_math_1.cloneDate)(dateCandidate);
|
|
1026
1037
|
this.resetInvalidDateSymbol(symbol);
|
|
1027
1038
|
}
|
|
1028
1039
|
else {
|
|
1029
1040
|
invalidDateFound = true;
|
|
1030
1041
|
this.setInvalidDatePart(symbol, {
|
|
1031
1042
|
value: day,
|
|
1032
|
-
date: kendo_date_math_1.cloneDate(newValueCandidate),
|
|
1033
|
-
startDate: kendo_date_math_1.cloneDate(this.value)
|
|
1043
|
+
date: (0, kendo_date_math_1.cloneDate)(newValueCandidate),
|
|
1044
|
+
startDate: (0, kendo_date_math_1.cloneDate)(this.value)
|
|
1034
1045
|
});
|
|
1035
1046
|
this.setExisting(symbol, false);
|
|
1036
1047
|
}
|
|
1037
1048
|
}
|
|
1038
1049
|
else if (dateCandidateExists) {
|
|
1039
|
-
newValue = kendo_date_math_1.cloneDate(dateCandidate);
|
|
1050
|
+
newValue = (0, kendo_date_math_1.cloneDate)(dateCandidate);
|
|
1040
1051
|
this.resetInvalidDateSymbol(symbol);
|
|
1041
1052
|
if (this.getExisting("d") && this.getExisting("y")) {
|
|
1042
1053
|
// changing from 31/Jan to 31/Feb to 28/Feb
|
|
@@ -1046,24 +1057,24 @@ var DateObject = /** @class */ (function () {
|
|
|
1046
1057
|
}
|
|
1047
1058
|
else {
|
|
1048
1059
|
this.resetInvalidDateSymbol(symbol);
|
|
1049
|
-
newValue = kendo_date_math_1.cloneDate(newValueCandidate);
|
|
1060
|
+
newValue = (0, kendo_date_math_1.cloneDate)(newValueCandidate);
|
|
1050
1061
|
}
|
|
1051
1062
|
}
|
|
1052
1063
|
else {
|
|
1053
1064
|
invalidDateFound = true;
|
|
1054
1065
|
this.setInvalidDatePart(symbol, {
|
|
1055
1066
|
value: day,
|
|
1056
|
-
date: kendo_date_math_1.cloneDate(this.value),
|
|
1057
|
-
startDate: kendo_date_math_1.cloneDate(this.value)
|
|
1067
|
+
date: (0, kendo_date_math_1.cloneDate)(this.value),
|
|
1068
|
+
startDate: (0, kendo_date_math_1.cloneDate)(this.value)
|
|
1058
1069
|
});
|
|
1059
1070
|
this.setExisting(symbol, false);
|
|
1060
1071
|
}
|
|
1061
1072
|
}
|
|
1062
1073
|
if (!invalidDateFound) {
|
|
1063
1074
|
this.setExisting(symbol, true);
|
|
1064
|
-
if (isInCaretMode && !utils_2.isValidDate(parsedDate)) {
|
|
1075
|
+
if (isInCaretMode && !(0, utils_2.isValidDate)(parsedDate)) {
|
|
1065
1076
|
var valueCandidate = this.intl.parseDate(basePrefix + middle + baseSuffix, this.format, this.localeId);
|
|
1066
|
-
if (utils_2.isValidDate(valueCandidate)) {
|
|
1077
|
+
if ((0, utils_2.isValidDate)(valueCandidate)) {
|
|
1067
1078
|
this._value = valueCandidate;
|
|
1068
1079
|
}
|
|
1069
1080
|
}
|
|
@@ -1103,14 +1114,14 @@ var DateObject = /** @class */ (function () {
|
|
|
1103
1114
|
switchToNext = textToParse.length > segmentLength;
|
|
1104
1115
|
}
|
|
1105
1116
|
}
|
|
1106
|
-
return utils_2.extend(parseResult, {
|
|
1117
|
+
return (0, utils_2.extend)(parseResult, {
|
|
1107
1118
|
value: null,
|
|
1108
1119
|
switchToNext: switchToNext,
|
|
1109
1120
|
hasInvalidDatePart: invalidDateFound
|
|
1110
1121
|
});
|
|
1111
1122
|
}
|
|
1112
1123
|
}
|
|
1113
|
-
return utils_2.extend(parseResult, { value: null, switchToNext: false });
|
|
1124
|
+
return (0, utils_2.extend)(parseResult, { value: null, switchToNext: false });
|
|
1114
1125
|
};
|
|
1115
1126
|
/**
|
|
1116
1127
|
* @hidden
|
|
@@ -1139,12 +1150,12 @@ var DateObject = /** @class */ (function () {
|
|
|
1139
1150
|
* @hidden
|
|
1140
1151
|
*/
|
|
1141
1152
|
DateObject.prototype.normalizeCentury = function (date) {
|
|
1142
|
-
if (!utils_2.isPresent(date)) {
|
|
1153
|
+
if (!(0, utils_2.isPresent)(date)) {
|
|
1143
1154
|
return date;
|
|
1144
1155
|
}
|
|
1145
|
-
var twoDigitYear = utils_2.cropTwoDigitYear(date);
|
|
1156
|
+
var twoDigitYear = (0, utils_2.cropTwoDigitYear)(date);
|
|
1146
1157
|
var centuryBase = this.getNormalizedCenturyBase(twoDigitYear);
|
|
1147
|
-
var normalizedDate = utils_2.setYears(date, centuryBase + twoDigitYear);
|
|
1158
|
+
var normalizedDate = (0, utils_2.setYears)(date, centuryBase + twoDigitYear);
|
|
1148
1159
|
return normalizedDate;
|
|
1149
1160
|
};
|
|
1150
1161
|
DateObject.prototype.incrementLeadingZero = function (symbol) {
|
|
@@ -1170,7 +1181,7 @@ var DateObject = /** @class */ (function () {
|
|
|
1170
1181
|
*/
|
|
1171
1182
|
DateObject.prototype.peek = function (value, pattern) {
|
|
1172
1183
|
var peekValue = value.replace(/^0*/, '') + '0';
|
|
1173
|
-
return utils_1.padZero(pattern.length - peekValue.length) + peekValue;
|
|
1184
|
+
return (0, utils_1.padZero)(pattern.length - peekValue.length) + peekValue;
|
|
1174
1185
|
};
|
|
1175
1186
|
/**
|
|
1176
1187
|
* @hidden
|
|
@@ -1323,20 +1334,20 @@ var DateObject = /** @class */ (function () {
|
|
|
1323
1334
|
if (!this.autoCorrectParts && this.getInvalidDatePartValue(symbol)) {
|
|
1324
1335
|
var datePartText = this.getInvalidDatePartValue(symbol).toString();
|
|
1325
1336
|
if (symbol === "M") {
|
|
1326
|
-
datePartText = (utils_2.parseToInt(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();
|
|
1337
|
+
datePartText = ((0, utils_2.parseToInt)(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();
|
|
1327
1338
|
if (partsForSegment.length > MONTH_PART_WITH_WORDS_THRESHOLD) {
|
|
1328
1339
|
resultText = formattedDates[symbol][formatSymbolIndex] + resultText;
|
|
1329
1340
|
}
|
|
1330
1341
|
else {
|
|
1331
|
-
datePartText = (utils_2.parseToInt(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();
|
|
1332
|
-
var formattedDatePart = utils_1.padZero(partsForSegment.length - datePartText.length) + datePartText;
|
|
1342
|
+
datePartText = ((0, utils_2.parseToInt)(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();
|
|
1343
|
+
var formattedDatePart = (0, utils_1.padZero)(partsForSegment.length - datePartText.length) + datePartText;
|
|
1333
1344
|
resultText = formattedDatePart + resultText;
|
|
1334
1345
|
formatSymbolIndexModifier = partsForSegment.length - 1;
|
|
1335
1346
|
ignoreFormatSymbolsCount = datePartText.length - partsForSegment.length;
|
|
1336
1347
|
}
|
|
1337
1348
|
}
|
|
1338
1349
|
else {
|
|
1339
|
-
var formattedDatePart = utils_1.padZero(partsForSegment.length - datePartText.length) + datePartText;
|
|
1350
|
+
var formattedDatePart = (0, utils_1.padZero)(partsForSegment.length - datePartText.length) + datePartText;
|
|
1340
1351
|
resultText = formattedDatePart + resultText;
|
|
1341
1352
|
formatSymbolIndexModifier = partsForSegment.length - 1;
|
|
1342
1353
|
ignoreFormatSymbolsCount = datePartText.length - partsForSegment.length;
|
|
@@ -1396,7 +1407,7 @@ var DateObject = /** @class */ (function () {
|
|
|
1396
1407
|
var shouldResetInvalidDate = true;
|
|
1397
1408
|
Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function (key) {
|
|
1398
1409
|
if (_this._partiallyInvalidDate.invalidDateParts[key] &&
|
|
1399
|
-
utils_2.isPresent(_this._partiallyInvalidDate.invalidDateParts[key].value)) {
|
|
1410
|
+
(0, utils_2.isPresent)(_this._partiallyInvalidDate.invalidDateParts[key].value)) {
|
|
1400
1411
|
shouldResetInvalidDate = false;
|
|
1401
1412
|
}
|
|
1402
1413
|
});
|
|
@@ -1444,7 +1455,7 @@ var DateObject = /** @class */ (function () {
|
|
|
1444
1455
|
var hasInvalidDatePart = false;
|
|
1445
1456
|
Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function (key) {
|
|
1446
1457
|
if (_this._partiallyInvalidDate.invalidDateParts[key] &&
|
|
1447
|
-
utils_2.isPresent(_this._partiallyInvalidDate.invalidDateParts[key].value)) {
|
|
1458
|
+
(0, utils_2.isPresent)(_this._partiallyInvalidDate.invalidDateParts[key].value)) {
|
|
1448
1459
|
hasInvalidDatePart = true;
|
|
1449
1460
|
}
|
|
1450
1461
|
});
|
|
@@ -1454,14 +1465,14 @@ var DateObject = /** @class */ (function () {
|
|
|
1454
1465
|
* @hidden
|
|
1455
1466
|
*/
|
|
1456
1467
|
DateObject.prototype.modifyDateSymbolWithOffset = function (date, symbol, offset) {
|
|
1457
|
-
var newValue = kendo_date_math_1.cloneDate(date);
|
|
1468
|
+
var newValue = (0, kendo_date_math_1.cloneDate)(date);
|
|
1458
1469
|
var timeModified = false;
|
|
1459
1470
|
switch (symbol) {
|
|
1460
1471
|
case 'y':
|
|
1461
1472
|
newValue.setFullYear(newValue.getFullYear() + offset);
|
|
1462
1473
|
break;
|
|
1463
1474
|
case 'M':
|
|
1464
|
-
newValue = kendo_date_math_1.addMonths(this.value, offset);
|
|
1475
|
+
newValue = (0, kendo_date_math_1.addMonths)(this.value, offset);
|
|
1465
1476
|
break;
|
|
1466
1477
|
case 'd':
|
|
1467
1478
|
case 'E':
|
|
@@ -1498,13 +1509,13 @@ var DateObject = /** @class */ (function () {
|
|
|
1498
1509
|
* @hidden
|
|
1499
1510
|
*/
|
|
1500
1511
|
DateObject.prototype.modifyDateSymbolWithValue = function (date, symbol, value) {
|
|
1501
|
-
var newValue = kendo_date_math_1.cloneDate(date);
|
|
1512
|
+
var newValue = (0, kendo_date_math_1.cloneDate)(date);
|
|
1502
1513
|
switch (symbol) {
|
|
1503
1514
|
case 'y':
|
|
1504
1515
|
newValue.setFullYear(value);
|
|
1505
1516
|
break;
|
|
1506
1517
|
case 'M':
|
|
1507
|
-
newValue = kendo_date_math_1.addMonths(date, value - date.getMonth());
|
|
1518
|
+
newValue = (0, kendo_date_math_1.addMonths)(date, value - date.getMonth());
|
|
1508
1519
|
break;
|
|
1509
1520
|
case 'd':
|
|
1510
1521
|
case 'E':
|
|
@@ -1568,16 +1579,12 @@ var DateObject = /** @class */ (function () {
|
|
|
1568
1579
|
// when start from empty date (01, then 010), padded zeros should be trimmed
|
|
1569
1580
|
var peekedValue = this.peek(middle, patternValue);
|
|
1570
1581
|
var peekedDateString = useBasePrefixAndSuffix ?
|
|
1571
|
-
""
|
|
1572
|
-
""
|
|
1582
|
+
"".concat(basePrefix).concat(peekedValue).concat(baseSuffix) :
|
|
1583
|
+
"".concat(prefix).concat(peekedValue).concat(suffix);
|
|
1573
1584
|
var peekedDate = this.intl.parseDate(peekedDateString, this.format, this.localeId);
|
|
1574
1585
|
var leadingZeroOffset = (this.leadingZero || {})[symbol] || 0;
|
|
1575
|
-
var patternSatisfied = (leadingZeroOffset + utils_1.unpadZero(middle).length) >= patternLength;
|
|
1576
|
-
var parsedPeekedValue = utils_2.parseToInt(peekedValue);
|
|
1577
|
-
if (symbol === "M") {
|
|
1578
|
-
}
|
|
1579
|
-
else if (symbol === "d") {
|
|
1580
|
-
}
|
|
1586
|
+
var patternSatisfied = (leadingZeroOffset + (0, utils_1.unpadZero)(middle).length) >= patternLength;
|
|
1587
|
+
var parsedPeekedValue = (0, utils_2.parseToInt)(peekedValue);
|
|
1581
1588
|
var switchToNext = peekedDate === null ||
|
|
1582
1589
|
(leadingZero[symbol] ?
|
|
1583
1590
|
patternValue.length <= middle.length :
|