@syncfusion/ej2-schedule 19.3.48 → 19.4.40
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/.github/PULL_REQUEST_TEMPLATE/Bug.md +63 -0
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +39 -0
- package/CHANGELOG.md +47 -10
- package/dist/ej2-schedule.umd.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +457 -120
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +460 -126
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/dist/global/ej2-schedule.min.js +2 -2
- package/dist/global/ej2-schedule.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +15 -15
- package/src/recurrence-editor/date-generator.js +3 -3
- package/src/recurrence-editor/recurrence-editor.js +2 -2
- package/src/schedule/actions/drag.js +14 -5
- package/src/schedule/actions/keyboard.d.ts +7 -0
- package/src/schedule/actions/keyboard.js +197 -28
- package/src/schedule/base/interface.d.ts +19 -0
- package/src/schedule/base/resource.js +1 -0
- package/src/schedule/base/schedule-model.d.ts +97 -20
- package/src/schedule/base/schedule.d.ts +96 -20
- package/src/schedule/base/schedule.js +27 -6
- package/src/schedule/base/util.d.ts +1 -0
- package/src/schedule/base/util.js +1 -0
- package/src/schedule/event-renderer/event-base.d.ts +2 -1
- package/src/schedule/event-renderer/event-base.js +20 -5
- package/src/schedule/event-renderer/inline-edit.js +8 -5
- package/src/schedule/event-renderer/month.js +1 -1
- package/src/schedule/event-renderer/timeline-view.js +4 -0
- package/src/schedule/event-renderer/vertical-view.js +9 -6
- package/src/schedule/event-renderer/year.js +1 -1
- package/src/schedule/exports/excel-export.d.ts +2 -1
- package/src/schedule/exports/excel-export.js +21 -18
- package/src/schedule/models/event-settings-model.d.ts +17 -9
- package/src/schedule/models/event-settings.d.ts +15 -8
- package/src/schedule/models/event-settings.js +6 -3
- package/src/schedule/models/views-model.d.ts +19 -0
- package/src/schedule/models/views.d.ts +17 -0
- package/src/schedule/models/views.js +6 -0
- package/src/schedule/popups/event-window.d.ts +0 -1
- package/src/schedule/popups/event-window.js +4 -5
- package/src/schedule/popups/form-validator.js +1 -1
- package/src/schedule/popups/quick-popups.js +3 -0
- package/src/schedule/renderer/agenda.js +2 -1
- package/src/schedule/renderer/header-renderer.d.ts +1 -0
- package/src/schedule/renderer/header-renderer.js +23 -8
- package/src/schedule/renderer/month.d.ts +4 -0
- package/src/schedule/renderer/month.js +69 -19
- package/src/schedule/renderer/renderer.js +6 -1
- package/src/schedule/renderer/timeline-year.js +4 -1
- package/src/schedule/renderer/view-base.js +9 -0
- package/src/schedule/renderer/year.d.ts +2 -2
- package/src/schedule/renderer/year.js +24 -6
- package/src/schedule/timezone/timezone.d.ts +3 -2
- package/src/schedule/timezone/timezone.js +0 -1
- package/styles/bootstrap-dark.css +108 -27
- package/styles/bootstrap.css +105 -27
- package/styles/bootstrap4.css +117 -62
- package/styles/bootstrap5-dark.css +118 -67
- package/styles/bootstrap5.css +118 -67
- package/styles/fabric-dark.css +108 -26
- package/styles/fabric.css +109 -26
- package/styles/highcontrast-light.css +104 -26
- package/styles/highcontrast.css +109 -28
- package/styles/material-dark.css +110 -32
- package/styles/material.css +103 -25
- package/styles/recurrence-editor/_bootstrap-dark-definition.scss +7 -0
- package/styles/recurrence-editor/_bootstrap-definition.scss +7 -0
- package/styles/recurrence-editor/_bootstrap4-definition.scss +7 -0
- package/styles/recurrence-editor/_bootstrap5-definition.scss +7 -0
- package/styles/recurrence-editor/_fabric-dark-definition.scss +8 -0
- package/styles/recurrence-editor/_fabric-definition.scss +7 -0
- package/styles/recurrence-editor/_fluent-definition.scss +15 -0
- package/styles/recurrence-editor/_highcontrast-definition.scss +7 -0
- package/styles/recurrence-editor/_highcontrast-light-definition.scss +7 -0
- package/styles/recurrence-editor/_layout.scss +20 -4
- package/styles/recurrence-editor/_material-dark-definition.scss +7 -0
- package/styles/recurrence-editor/_material-definition.scss +7 -0
- package/styles/recurrence-editor/_tailwind-definition.scss +15 -8
- package/styles/recurrence-editor/bootstrap-dark.css +20 -4
- package/styles/recurrence-editor/bootstrap.css +20 -4
- package/styles/recurrence-editor/bootstrap4.css +20 -4
- package/styles/recurrence-editor/bootstrap5-dark.css +20 -4
- package/styles/recurrence-editor/bootstrap5.css +20 -4
- package/styles/recurrence-editor/fabric-dark.css +20 -4
- package/styles/recurrence-editor/fabric.css +20 -4
- package/styles/recurrence-editor/highcontrast-light.css +20 -4
- package/styles/recurrence-editor/highcontrast.css +20 -4
- package/styles/recurrence-editor/material-dark.css +20 -4
- package/styles/recurrence-editor/material.css +20 -4
- package/styles/recurrence-editor/tailwind-dark.css +20 -4
- package/styles/recurrence-editor/tailwind.css +20 -4
- package/styles/schedule/_bootstrap-dark-definition.scss +22 -1
- package/styles/schedule/_bootstrap-definition.scss +22 -1
- package/styles/schedule/_bootstrap4-definition.scss +23 -1
- package/styles/schedule/_bootstrap5-definition.scss +145 -119
- package/styles/schedule/_fabric-dark-definition.scss +22 -1
- package/styles/schedule/_fabric-definition.scss +22 -1
- package/styles/schedule/_fluent-definition.scss +218 -0
- package/styles/schedule/_highcontrast-definition.scss +22 -1
- package/styles/schedule/_highcontrast-light-definition.scss +22 -1
- package/styles/schedule/_layout.scss +95 -158
- package/styles/schedule/_material-dark-definition.scss +22 -1
- package/styles/schedule/_material-definition.scss +21 -0
- package/styles/schedule/_tailwind-definition.scss +216 -195
- package/styles/schedule/_theme.scss +1 -1
- package/styles/schedule/bootstrap-dark.css +88 -23
- package/styles/schedule/bootstrap.css +85 -23
- package/styles/schedule/bootstrap4.css +97 -58
- package/styles/schedule/bootstrap5-dark.css +98 -63
- package/styles/schedule/bootstrap5.css +98 -63
- package/styles/schedule/fabric-dark.css +88 -22
- package/styles/schedule/fabric.css +89 -22
- package/styles/schedule/highcontrast-light.css +84 -22
- package/styles/schedule/highcontrast.css +89 -24
- package/styles/schedule/icons/_fluent.scss +231 -0
- package/styles/schedule/icons/_tailwind.scss +231 -231
- package/styles/schedule/material-dark.css +90 -28
- package/styles/schedule/material.css +83 -21
- package/styles/schedule/tailwind-dark.css +94 -52
- package/styles/schedule/tailwind.css +94 -52
- package/styles/tailwind-dark.css +114 -56
- package/styles/tailwind.css +114 -56
|
@@ -324,8 +324,10 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
324
324
|
enableRtl: this.parent.enableRtl
|
|
325
325
|
});
|
|
326
326
|
var calendarView = this.getCalendarView();
|
|
327
|
+
var isDisplayDate = this.parent.currentView === 'Month' &&
|
|
328
|
+
!isNullOrUndefined(this.parent.activeViewOptions.displayDate) && !this.hasSelectedDate();
|
|
327
329
|
this.headerCalendar = new Calendar({
|
|
328
|
-
value: this.parent.selectedDate,
|
|
330
|
+
value: isDisplayDate ? this.parent.activeViewOptions.displayDate : this.parent.selectedDate,
|
|
329
331
|
min: this.parent.minDate,
|
|
330
332
|
max: this.parent.maxDate,
|
|
331
333
|
firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,
|
|
@@ -364,6 +366,7 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
364
366
|
var strClass = args.item.cssClass.replace('e-views ', '');
|
|
365
367
|
var data;
|
|
366
368
|
var isSameTime;
|
|
369
|
+
var currentTime;
|
|
367
370
|
switch (strClass) {
|
|
368
371
|
case 'e-date-range':
|
|
369
372
|
if (!this.headerPopup) {
|
|
@@ -413,8 +416,13 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
413
416
|
this.parent.changeView('TimelineYear', args.originalEvent, undefined, this.calculateViewIndex(args));
|
|
414
417
|
break;
|
|
415
418
|
case 'e-today':
|
|
416
|
-
|
|
417
|
-
|
|
419
|
+
currentTime = util.resetTime(this.parent.getCurrentTime());
|
|
420
|
+
if (this.parent.currentView === 'Agenda' || !this.parent.isSelectedDate(currentTime) ||
|
|
421
|
+
this.parent.currentView === 'Month' && this.parent.activeViewOptions.displayDate && !this.hasSelectedDate() &&
|
|
422
|
+
util.resetTime(this.parent.activeViewOptions.displayDate) !== currentTime || this.parent.currentView === 'Month' &&
|
|
423
|
+
this.parent.activeViewOptions.numberOfWeeks > 0 && !this.hasSelectedDate()
|
|
424
|
+
&& util.resetTime(util.firstDateOfMonth(this.parent.selectedDate)) !== currentTime) {
|
|
425
|
+
this.parent.changeDate(currentTime, args.originalEvent);
|
|
418
426
|
}
|
|
419
427
|
break;
|
|
420
428
|
case 'e-prev':
|
|
@@ -433,8 +441,8 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
433
441
|
var slotCount = this.parent.activeViewOptions.timeScale.slotCount;
|
|
434
442
|
var msInterval = (interval * util.MS_PER_MINUTE) / slotCount;
|
|
435
443
|
var startTime = new Date(this.parent.selectedDate.getTime());
|
|
436
|
-
var
|
|
437
|
-
startTime.setHours(
|
|
444
|
+
var currentTime_1 = this.parent.getCurrentTime();
|
|
445
|
+
startTime.setHours(currentTime_1.getHours(), (Math.round(startTime.getMinutes() / msInterval) * msInterval), 0);
|
|
438
446
|
var endTime = new Date(new Date(startTime.getTime()).setMilliseconds(startTime.getMilliseconds() + msInterval));
|
|
439
447
|
data = { startTime: startTime, endTime: endTime, isAllDay: false };
|
|
440
448
|
}
|
|
@@ -449,6 +457,11 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
449
457
|
toolbarPopUp.ej2_instances[0].hide({ name: 'SlideUp', duration: 100 });
|
|
450
458
|
}
|
|
451
459
|
};
|
|
460
|
+
HeaderRenderer.prototype.hasSelectedDate = function () {
|
|
461
|
+
var selectedTime = util.resetTime(this.parent.selectedDate).getTime();
|
|
462
|
+
return selectedTime >= this.parent.activeView.getStartDate().getTime() &&
|
|
463
|
+
selectedTime <= this.parent.activeView.getEndDate().getTime();
|
|
464
|
+
};
|
|
452
465
|
HeaderRenderer.prototype.getHeaderElement = function () {
|
|
453
466
|
return this.toolbarObj.element;
|
|
454
467
|
};
|
|
@@ -493,9 +506,11 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
493
506
|
lastDate = util.addDays(firstDate, 7 * this.parent.activeViewOptions.interval);
|
|
494
507
|
}
|
|
495
508
|
if (this.parent.currentView === 'Month') {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
509
|
+
var isCustomMonth = !isNullOrUndefined(this.parent.activeViewOptions.displayDate) ||
|
|
510
|
+
this.parent.activeViewOptions.numberOfWeeks > 0;
|
|
511
|
+
firstDate = isCustomMonth ? this.parent.activeView.getStartDate() : util.firstDateOfMonth(this.parent.selectedDate);
|
|
512
|
+
lastDate = isCustomMonth ? this.parent.activeView.getEndDate() :
|
|
513
|
+
util.lastDateOfMonth(util.addMonths(firstDate, this.parent.activeViewOptions.interval - 1));
|
|
499
514
|
}
|
|
500
515
|
if (!isNullOrUndefined(prevNavEle)) {
|
|
501
516
|
this.toolbarObj.enableItems(prevNavEle, firstDate > this.parent.minDate);
|
|
@@ -42,13 +42,17 @@ export declare class Month extends ViewBase implements IRenderer {
|
|
|
42
42
|
private renderDateHeaderElement;
|
|
43
43
|
getMonthStart(currentDate: Date): Date;
|
|
44
44
|
getMonthEnd(currentDate: Date): Date;
|
|
45
|
+
private isCustomRange;
|
|
45
46
|
getRenderDates(workDays?: number[]): Date[];
|
|
46
47
|
getNextPreviousDate(type: string): Date;
|
|
48
|
+
getStartDate(): Date;
|
|
49
|
+
getEndDate(): Date;
|
|
47
50
|
getEndDateFromStartDate(start: Date): Date;
|
|
48
51
|
getDateRangeText(): string;
|
|
49
52
|
getLabelText(view: string): string;
|
|
50
53
|
private createWeekNumberElement;
|
|
51
54
|
unWireEvents(): void;
|
|
55
|
+
private isCustomMonth;
|
|
52
56
|
protected getModuleName(): string;
|
|
53
57
|
destroy(): void;
|
|
54
58
|
}
|
|
@@ -144,10 +144,11 @@ var Month = /** @class */ (function (_super) {
|
|
|
144
144
|
Month.prototype.getDateSlots = function (renderDates, workDays) {
|
|
145
145
|
var count = this.parent.activeViewOptions.showWeekend ? util.WEEK_LENGTH : workDays.length;
|
|
146
146
|
var dateSlots = [];
|
|
147
|
+
var isCurrentMonth = this.isCurrentMonth(this.parent.selectedDate);
|
|
147
148
|
for (var col = 0; col < count; col++) {
|
|
148
149
|
var classList = [cls.HEADER_CELLS_CLASS];
|
|
149
150
|
var currentDateIndex = renderDates.slice(0, count).map(function (date) { return date.getDay(); });
|
|
150
|
-
if (
|
|
151
|
+
if (isCurrentMonth && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
|
|
151
152
|
classList.push(cls.CURRENT_DAY_CLASS);
|
|
152
153
|
}
|
|
153
154
|
dateSlots.push({ date: renderDates[col], type: 'monthDay', className: classList, colSpan: 1, workDays: workDays });
|
|
@@ -186,6 +187,9 @@ var Month = /** @class */ (function (_super) {
|
|
|
186
187
|
this.renderResourceMobileLayout();
|
|
187
188
|
}
|
|
188
189
|
this.parent.notify(event.contentReady, {});
|
|
190
|
+
if (this.parent.uiStateValues.isCustomMonth) {
|
|
191
|
+
this.parent.uiStateValues.isCustomMonth = false;
|
|
192
|
+
}
|
|
189
193
|
};
|
|
190
194
|
Month.prototype.refreshHeader = function () {
|
|
191
195
|
remove(this.element.querySelector('tbody tr'));
|
|
@@ -371,7 +375,7 @@ var Month = /** @class */ (function (_super) {
|
|
|
371
375
|
return slotDatas;
|
|
372
376
|
};
|
|
373
377
|
Month.prototype.updateClassList = function (data) {
|
|
374
|
-
if (this.isOtherMonth(data.date)) {
|
|
378
|
+
if (!this.isCustomMonth() && this.isOtherMonth(data.date)) {
|
|
375
379
|
data.className.push(cls.OTHERMONTH_CLASS);
|
|
376
380
|
}
|
|
377
381
|
if (!this.parent.isMinMaxDate(data.date)) {
|
|
@@ -480,15 +484,34 @@ var Month = /** @class */ (function (_super) {
|
|
|
480
484
|
}
|
|
481
485
|
};
|
|
482
486
|
Month.prototype.getMonthStart = function (currentDate) {
|
|
483
|
-
var
|
|
484
|
-
var
|
|
485
|
-
|
|
487
|
+
var useDisplayDate = this.parent.currentView === 'Month' && !isNullOrUndefined(this.parent.activeViewOptions.displayDate) && (this.parent.uiStateValues.isCustomMonth || this.isCustomRange());
|
|
488
|
+
var date = useDisplayDate ? this.parent.activeViewOptions.displayDate : !(this.parent.uiStateValues.isCustomMonth ||
|
|
489
|
+
this.isCustomRange()) && this.isCustomMonth() ? currentDate : this.parent.calendarUtil.firstDateOfMonth(currentDate);
|
|
490
|
+
var monthStart = util.getWeekFirstDate(date, this.parent.activeViewOptions.firstDayOfWeek);
|
|
491
|
+
return new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate());
|
|
486
492
|
};
|
|
487
493
|
Month.prototype.getMonthEnd = function (currentDate) {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
494
|
+
if (this.isCustomMonth()) {
|
|
495
|
+
var start = this.getMonthStart(currentDate);
|
|
496
|
+
var numberOfDays = util.WEEK_LENGTH * (this.parent.activeViewOptions.numberOfWeeks > 0 ?
|
|
497
|
+
this.parent.activeViewOptions.numberOfWeeks : util.DEFAULT_WEEKS);
|
|
498
|
+
return util.addDays(start, (numberOfDays - 1));
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
var endDate = util.addMonths(currentDate, this.parent.activeViewOptions.interval - 1);
|
|
502
|
+
var lastWeekOfMonth = util.getWeekFirstDate(this.parent.calendarUtil.lastDateOfMonth(endDate), this.parent.activeViewOptions.firstDayOfWeek);
|
|
503
|
+
return util.addDays(lastWeekOfMonth, util.WEEK_LENGTH - 1);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
Month.prototype.isCustomRange = function () {
|
|
507
|
+
var dates = this.parent.getCurrentViewDates();
|
|
508
|
+
if (dates && dates.length > 0) {
|
|
509
|
+
var selectedTime = util.resetTime(this.parent.selectedDate).getTime();
|
|
510
|
+
var weekFirstDate = util.getWeekFirstDate(dates[dates.length - 1], this.parent.activeViewOptions.firstDayOfWeek);
|
|
511
|
+
return !(selectedTime >= util.getWeekFirstDate(dates[0], this.parent.activeViewOptions.firstDayOfWeek).getTime() &&
|
|
512
|
+
selectedTime <= util.addDays(weekFirstDate, 6).getTime());
|
|
513
|
+
}
|
|
514
|
+
return false;
|
|
492
515
|
};
|
|
493
516
|
Month.prototype.getRenderDates = function (workDays) {
|
|
494
517
|
var renderDates = [];
|
|
@@ -518,34 +541,57 @@ var Month = /** @class */ (function (_super) {
|
|
|
518
541
|
return renderDates;
|
|
519
542
|
};
|
|
520
543
|
Month.prototype.getNextPreviousDate = function (type) {
|
|
521
|
-
if (
|
|
522
|
-
|
|
544
|
+
if (this.isCustomMonth()) {
|
|
545
|
+
var dates = this.parent.getCurrentViewDates();
|
|
546
|
+
var date = util.getWeekFirstDate(type === 'next' ? dates[dates.length - 1]
|
|
547
|
+
: dates[0], this.parent.activeViewOptions.firstDayOfWeek);
|
|
548
|
+
return util.addDays(date, type === 'next' ? util.WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
|
|
549
|
+
this.parent.activeViewOptions.numberOfWeeks : util.DEFAULT_WEEKS) * util.WEEK_LENGTH);
|
|
523
550
|
}
|
|
524
551
|
else {
|
|
525
|
-
return util.addMonths(this.parent.selectedDate, -
|
|
552
|
+
return util.addMonths(this.parent.selectedDate, ((type === 'next' ? 1 : -1) * this.parent.activeViewOptions.interval));
|
|
526
553
|
}
|
|
527
554
|
};
|
|
555
|
+
Month.prototype.getStartDate = function () {
|
|
556
|
+
return this.getMonthStart(this.parent.selectedDate);
|
|
557
|
+
};
|
|
558
|
+
Month.prototype.getEndDate = function () {
|
|
559
|
+
return this.getMonthEnd(this.parent.selectedDate);
|
|
560
|
+
};
|
|
528
561
|
Month.prototype.getEndDateFromStartDate = function (start) {
|
|
529
562
|
return util.addDays(new Date(start.getTime()), 1);
|
|
530
563
|
};
|
|
531
564
|
Month.prototype.getDateRangeText = function () {
|
|
532
565
|
if (this.parent.isAdaptive || isNullOrUndefined(this.parent.activeViewOptions.dateFormat)) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
566
|
+
var startDate = this.parent.selectedDate;
|
|
567
|
+
var endDate = void 0;
|
|
568
|
+
var updateCustomRange = false;
|
|
569
|
+
if (this.isCustomMonth()) {
|
|
570
|
+
var dates = this.parent.getCurrentViewDates();
|
|
571
|
+
updateCustomRange = dates[0].getMonth() !== dates[dates.length - 1].getMonth() ||
|
|
572
|
+
dates[0].getFullYear() !== dates[dates.length - 1].getFullYear();
|
|
573
|
+
if (updateCustomRange) {
|
|
574
|
+
startDate = dates[0];
|
|
575
|
+
endDate = dates[dates.length - 1];
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
var isUpdateDateRange = (this.parent.currentView !== 'Month' || !this.isCustomMonth());
|
|
579
|
+
if (this.parent.activeViewOptions.interval > 1 && isUpdateDateRange || updateCustomRange) {
|
|
580
|
+
endDate = endDate ? endDate : util.addMonths(util.lastDateOfMonth(startDate), this.parent.activeViewOptions.interval - 1);
|
|
581
|
+
if (startDate.getFullYear() === endDate.getFullYear()) {
|
|
582
|
+
var monthNames = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' - ' +
|
|
537
583
|
(this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() })) +
|
|
538
584
|
this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
|
|
539
585
|
return util.capitalizeFirstWord(monthNames, 'single');
|
|
540
586
|
}
|
|
541
|
-
var text = (this.parent.globalize.formatDate(
|
|
542
|
-
|
|
587
|
+
var text = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' ' +
|
|
588
|
+
startDate.getFullYear() + ' - ' +
|
|
543
589
|
this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() }) +
|
|
544
590
|
this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
|
|
545
591
|
return util.capitalizeFirstWord(text, 'single');
|
|
546
592
|
}
|
|
547
593
|
var format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
|
|
548
|
-
return util.capitalizeFirstWord(this.parent.globalize.formatDate(
|
|
594
|
+
return util.capitalizeFirstWord(this.parent.globalize.formatDate(startDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
|
|
549
595
|
}
|
|
550
596
|
return this.formatDateRange(this.parent.selectedDate);
|
|
551
597
|
};
|
|
@@ -570,6 +616,10 @@ var Month = /** @class */ (function (_super) {
|
|
|
570
616
|
EventHandler.remove(contentScrollableEle, 'scroll', this.onContentScroll);
|
|
571
617
|
}
|
|
572
618
|
};
|
|
619
|
+
Month.prototype.isCustomMonth = function () {
|
|
620
|
+
return this.parent.currentView === 'Month' &&
|
|
621
|
+
(!isNullOrUndefined(this.parent.activeViewOptions.displayDate) || this.parent.activeViewOptions.numberOfWeeks > 0);
|
|
622
|
+
};
|
|
573
623
|
Month.prototype.getModuleName = function () {
|
|
574
624
|
return 'month';
|
|
575
625
|
};
|
|
@@ -18,7 +18,12 @@ var Render = /** @class */ (function () {
|
|
|
18
18
|
};
|
|
19
19
|
Render.prototype.initializeLayout = function (viewName) {
|
|
20
20
|
if (this.parent.activeView) {
|
|
21
|
-
|
|
21
|
+
var templates = [
|
|
22
|
+
'cellTemplate', 'eventTemplate', 'tooltipTemplate', 'majorSlotTemplate', 'minorSlotTemplate',
|
|
23
|
+
'headerTooltipTemplate', 'dateHeaderTemplate', 'dayHeaderTemplate', 'mothHeaderTemplate',
|
|
24
|
+
'headerIndentTemplate', 'resourceHeaderTemplate', 'cellHeaderTemplate'
|
|
25
|
+
];
|
|
26
|
+
this.parent.resetTemplates(templates);
|
|
22
27
|
this.parent.activeView.removeEventListener();
|
|
23
28
|
this.parent.activeView.destroy();
|
|
24
29
|
}
|
|
@@ -43,6 +43,9 @@ var TimelineYear = /** @class */ (function (_super) {
|
|
|
43
43
|
tr.appendChild(leftHeaderCells);
|
|
44
44
|
leftHeaderCells.appendChild(this.renderResourceHeader(cls.LEFT_INDENT_WRAP_CLASS));
|
|
45
45
|
}
|
|
46
|
+
var isHorizontal = this.parent.activeViewOptions.orientation === 'Horizontal';
|
|
47
|
+
var isGroup = this.parent.activeViewOptions.group.resources.length > 0;
|
|
48
|
+
this.isInverseTableSelect = isHorizontal && !isGroup ? false : true;
|
|
46
49
|
var td = createElement('td');
|
|
47
50
|
tr.appendChild(td);
|
|
48
51
|
var container = createElement('div', { className: cls.DATE_HEADER_CONTAINER_CLASS });
|
|
@@ -75,7 +78,7 @@ var TimelineYear = /** @class */ (function (_super) {
|
|
|
75
78
|
}
|
|
76
79
|
else {
|
|
77
80
|
if (this.parent.monthHeaderTemplate) {
|
|
78
|
-
append(this.renderDayMonthHeaderTemplate(date, months[column], '
|
|
81
|
+
append(this.renderDayMonthHeaderTemplate(date, months[column], 'monthHeaderTemplate'), innerTd);
|
|
79
82
|
}
|
|
80
83
|
else {
|
|
81
84
|
innerTd.innerHTML = "<span>" + this.getMonthName(date) + "</span>";
|
|
@@ -209,6 +209,10 @@ var ViewBase = /** @class */ (function () {
|
|
|
209
209
|
return date.setHours(0, 0, 0, 0) === this.parent.getCurrentTime().setHours(0, 0, 0, 0);
|
|
210
210
|
};
|
|
211
211
|
ViewBase.prototype.isCurrentMonth = function (date) {
|
|
212
|
+
if (this.parent.activeViewOptions.displayDate || this.parent.activeViewOptions.numberOfWeeks > 0) {
|
|
213
|
+
return this.parent.activeView.getStartDate().getTime() <= this.parent.getCurrentTime().getTime() &&
|
|
214
|
+
this.parent.activeView.getEndDate().getTime() >= this.parent.getCurrentTime().getTime();
|
|
215
|
+
}
|
|
212
216
|
return date.getFullYear() ===
|
|
213
217
|
this.parent.getCurrentTime().getFullYear() && date.getMonth() === this.parent.getCurrentTime().getMonth();
|
|
214
218
|
};
|
|
@@ -441,6 +445,11 @@ var ViewBase = /** @class */ (function () {
|
|
|
441
445
|
setStyleAttribute(resourceColumn, { 'height': formatUnit(content.clientHeight) });
|
|
442
446
|
}
|
|
443
447
|
}
|
|
448
|
+
var headerCellElements = [].slice.call(this.element.querySelectorAll('.' + cls.HEADER_CELLS_CLASS));
|
|
449
|
+
headerCellElements.forEach(function (ele) {
|
|
450
|
+
var headerCellColSpan = parseInt(ele.getAttribute('colspan'), 10);
|
|
451
|
+
setStyleAttribute(ele, { 'width': formatUnit(colWidth_1 * headerCellColSpan) });
|
|
452
|
+
});
|
|
444
453
|
}
|
|
445
454
|
};
|
|
446
455
|
ViewBase.prototype.resetColWidth = function () {
|
|
@@ -29,8 +29,8 @@ export declare class Year extends ViewBase implements IRenderer {
|
|
|
29
29
|
private onCellClick;
|
|
30
30
|
onContentScroll(e: Event): void;
|
|
31
31
|
onScrollUiUpdate(args: NotifyEventArgs): void;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
getStartDate(): Date;
|
|
33
|
+
getEndDate(): Date;
|
|
34
34
|
startDate(): Date;
|
|
35
35
|
endDate(): Date;
|
|
36
36
|
getEndDateFromStartDate(start: Date): Date;
|
|
@@ -236,10 +236,27 @@ var Year = /** @class */ (function (_super) {
|
|
|
236
236
|
Year.prototype.onCellClick = function (e) {
|
|
237
237
|
var target = closest(e.target, '.' + cls.WORK_CELLS_CLASS);
|
|
238
238
|
var startDate = this.parent.getDateFromElement(target);
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
this.parent.activeCellsData = this.parent.getCellDetails(target);
|
|
240
|
+
var isPrevious = startDate.getTime() < this.getStartDate().getTime();
|
|
241
|
+
if (isPrevious || startDate.getTime() > this.getEndDate().getTime()) {
|
|
242
|
+
this.parent.changeDate(this.parent.activeView.getNextPreviousDate(isPrevious ? 'previous' : 'next'), e);
|
|
243
|
+
var activeDate = this.parent.activeCellsData.startTime.getTime();
|
|
244
|
+
var inRange = activeDate >= this.getStartDate().getTime() && activeDate <= this.getEndDate().getTime();
|
|
245
|
+
var dateAttr = inRange ? activeDate : (isPrevious ? this.getEndDate() : this.getStartDate()).getTime();
|
|
246
|
+
var selectedCell = this.parent.element.querySelector(':not(.' + cls.OTHERMONTH_CLASS + ')[data-date="' + dateAttr + '"]');
|
|
247
|
+
this.parent.selectCell(selectedCell);
|
|
248
|
+
this.parent.activeCellsData = this.parent.getCellDetails(selectedCell);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
var endDate = util.addDays(new Date(startDate.getTime()), 1);
|
|
252
|
+
var filteredEvents = this.parent.eventBase.filterEvents(startDate, endDate);
|
|
253
|
+
var moreEventArgs = { date: startDate, event: filteredEvents, element: e.target };
|
|
254
|
+
if (target.classList.contains(cls.OTHERMONTH_CLASS)) {
|
|
255
|
+
target = this.parent.element.querySelector(':not(.' + cls.OTHERMONTH_CLASS + ')[data-date="' + target.getAttribute('data-date') + '"]');
|
|
256
|
+
}
|
|
257
|
+
this.parent.activeCellsData = this.parent.getCellDetails(target);
|
|
258
|
+
this.parent.quickPopup.moreEventClick(moreEventArgs, endDate);
|
|
259
|
+
}
|
|
243
260
|
};
|
|
244
261
|
Year.prototype.onContentScroll = function (e) {
|
|
245
262
|
var target = e.target;
|
|
@@ -291,10 +308,10 @@ var Year = /** @class */ (function (_super) {
|
|
|
291
308
|
return util.addDays(util.addMonths(this.getStartDate(), this.parent.monthsCount), -1);
|
|
292
309
|
};
|
|
293
310
|
Year.prototype.startDate = function () {
|
|
294
|
-
return util.getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek);
|
|
311
|
+
return this.parent.currentView === 'Year' ? util.getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek) : this.getStartDate();
|
|
295
312
|
};
|
|
296
313
|
Year.prototype.endDate = function () {
|
|
297
|
-
return util.addDays(util.getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1);
|
|
314
|
+
return this.parent.currentView === 'Year' ? util.addDays(util.getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1) : this.getEndDate();
|
|
298
315
|
};
|
|
299
316
|
Year.prototype.getEndDateFromStartDate = function (start) {
|
|
300
317
|
var date = new Date(start.getTime());
|
|
@@ -337,6 +354,7 @@ var Year = /** @class */ (function (_super) {
|
|
|
337
354
|
EventHandler.add(element, 'click', this.onCellClick, this);
|
|
338
355
|
}
|
|
339
356
|
else {
|
|
357
|
+
EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
|
|
340
358
|
EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
|
|
341
359
|
if (!this.parent.isAdaptive) {
|
|
342
360
|
EventHandler.add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { TimezoneFields } from '../base/interface';
|
|
1
2
|
/**
|
|
2
3
|
* Time zone
|
|
3
4
|
*/
|
|
4
5
|
export declare class Timezone {
|
|
5
|
-
timezoneData:
|
|
6
|
+
timezoneData: TimezoneFields[];
|
|
6
7
|
constructor();
|
|
7
8
|
offset(date: Date, timezone: string): number;
|
|
8
9
|
convert(date: Date, fromOffset: number | string, toOffset: number | string): Date;
|
|
@@ -12,4 +13,4 @@ export declare class Timezone {
|
|
|
12
13
|
getLocalTimezoneName(): string;
|
|
13
14
|
private getTimezoneData;
|
|
14
15
|
}
|
|
15
|
-
export declare const timezoneData:
|
|
16
|
+
export declare const timezoneData: TimezoneFields[];
|