@syncfusion/ej2-schedule 19.3.46 → 19.4.38
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 +49 -5
- 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 +479 -133
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +480 -137
- 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/crud.js +2 -0
- package/src/schedule/actions/drag.js +28 -18
- 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 +97 -21
- package/src/schedule/base/schedule.js +27 -5
- package/src/schedule/base/type.d.ts +4 -0
- 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 -0
- package/src/schedule/event-renderer/event-base.js +29 -9
- package/src/schedule/event-renderer/inline-edit.js +8 -5
- package/src/schedule/event-renderer/month.js +2 -2
- 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 +20 -1
- package/src/schedule/models/event-settings.d.ts +18 -0
- package/src/schedule/models/event-settings.js +6 -0
- 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 +4 -1
- package/src/schedule/popups/quick-popups.js +3 -0
- package/src/schedule/renderer/agenda.js +3 -1
- package/src/schedule/renderer/header-renderer.d.ts +1 -0
- package/src/schedule/renderer/header-renderer.js +22 -8
- package/src/schedule/renderer/month.d.ts +4 -0
- package/src/schedule/renderer/month.js +68 -19
- package/src/schedule/renderer/timeline-year.js +3 -0
- 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
|
@@ -67,7 +67,8 @@ var Agenda = /** @class */ (function (_super) {
|
|
|
67
67
|
var event_1 = _a[_i];
|
|
68
68
|
delete event_1.generatedDates;
|
|
69
69
|
}
|
|
70
|
-
var eventCollection =
|
|
70
|
+
var eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ?
|
|
71
|
+
args.processedData : this.parent.eventsProcessed;
|
|
71
72
|
if (this.parent.uiStateValues.isGroupAdaptive) {
|
|
72
73
|
var resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
|
|
73
74
|
this.dataSource = this.parent.eventBase.filterEventsByResource(resource, this.dataSource);
|
|
@@ -171,6 +172,7 @@ var Agenda = /** @class */ (function (_super) {
|
|
|
171
172
|
var filterData = this.appointmentFiltering(agendaDate);
|
|
172
173
|
var nTr = this.createTableRowElement(agendaDate, 'data');
|
|
173
174
|
if (this.element.querySelector('tr[aria-rowindex="' + parseInt(nTr.getAttribute('aria-rowindex'), 10) + '"]')) {
|
|
175
|
+
agendaDate = util.addDays(agendaDate, 1);
|
|
174
176
|
continue;
|
|
175
177
|
}
|
|
176
178
|
var dTd = nTr.children[0];
|
|
@@ -36,6 +36,7 @@ export declare class HeaderRenderer {
|
|
|
36
36
|
setCalendarTimezone(): void;
|
|
37
37
|
private calculateViewIndex;
|
|
38
38
|
private toolbarClickHandler;
|
|
39
|
+
private hasSelectedDate;
|
|
39
40
|
getHeaderElement(): HTMLElement;
|
|
40
41
|
updateHeaderItems(classType: string): void;
|
|
41
42
|
previousNextIconHandler(): void;
|
|
@@ -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,
|
|
@@ -413,8 +415,13 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
413
415
|
this.parent.changeView('TimelineYear', args.originalEvent, undefined, this.calculateViewIndex(args));
|
|
414
416
|
break;
|
|
415
417
|
case 'e-today':
|
|
416
|
-
|
|
417
|
-
|
|
418
|
+
var currentTime = util.resetTime(this.parent.getCurrentTime());
|
|
419
|
+
if (this.parent.currentView === 'Agenda' || !this.parent.isSelectedDate(currentTime) ||
|
|
420
|
+
this.parent.currentView === 'Month' && this.parent.activeViewOptions.displayDate && !this.hasSelectedDate() &&
|
|
421
|
+
util.resetTime(this.parent.activeViewOptions.displayDate) !== currentTime || this.parent.currentView === 'Month' &&
|
|
422
|
+
this.parent.activeViewOptions.numberOfWeeks > 0 && !this.hasSelectedDate()
|
|
423
|
+
&& util.resetTime(util.firstDateOfMonth(this.parent.selectedDate)) !== currentTime) {
|
|
424
|
+
this.parent.changeDate(currentTime, args.originalEvent);
|
|
418
425
|
}
|
|
419
426
|
break;
|
|
420
427
|
case 'e-prev':
|
|
@@ -433,8 +440,8 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
433
440
|
var slotCount = this.parent.activeViewOptions.timeScale.slotCount;
|
|
434
441
|
var msInterval = (interval * util.MS_PER_MINUTE) / slotCount;
|
|
435
442
|
var startTime = new Date(this.parent.selectedDate.getTime());
|
|
436
|
-
var
|
|
437
|
-
startTime.setHours(
|
|
443
|
+
var currentTime_1 = this.parent.getCurrentTime();
|
|
444
|
+
startTime.setHours(currentTime_1.getHours(), (Math.round(startTime.getMinutes() / msInterval) * msInterval), 0);
|
|
438
445
|
var endTime = new Date(new Date(startTime.getTime()).setMilliseconds(startTime.getMilliseconds() + msInterval));
|
|
439
446
|
data = { startTime: startTime, endTime: endTime, isAllDay: false };
|
|
440
447
|
}
|
|
@@ -449,6 +456,11 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
449
456
|
toolbarPopUp.ej2_instances[0].hide({ name: 'SlideUp', duration: 100 });
|
|
450
457
|
}
|
|
451
458
|
};
|
|
459
|
+
HeaderRenderer.prototype.hasSelectedDate = function () {
|
|
460
|
+
var selectedTime = util.resetTime(this.parent.selectedDate).getTime();
|
|
461
|
+
return selectedTime >= this.parent.activeView.getStartDate().getTime() &&
|
|
462
|
+
selectedTime <= this.parent.activeView.getEndDate().getTime();
|
|
463
|
+
};
|
|
452
464
|
HeaderRenderer.prototype.getHeaderElement = function () {
|
|
453
465
|
return this.toolbarObj.element;
|
|
454
466
|
};
|
|
@@ -493,9 +505,11 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
493
505
|
lastDate = util.addDays(firstDate, 7 * this.parent.activeViewOptions.interval);
|
|
494
506
|
}
|
|
495
507
|
if (this.parent.currentView === 'Month') {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
508
|
+
var isCustomMonth = !isNullOrUndefined(this.parent.activeViewOptions.displayDate) ||
|
|
509
|
+
this.parent.activeViewOptions.numberOfWeeks > 0;
|
|
510
|
+
firstDate = isCustomMonth ? this.parent.activeView.getStartDate() : util.firstDateOfMonth(this.parent.selectedDate);
|
|
511
|
+
lastDate = isCustomMonth ? this.parent.activeView.getEndDate() :
|
|
512
|
+
util.lastDateOfMonth(util.addMonths(firstDate, this.parent.activeViewOptions.interval - 1));
|
|
499
513
|
}
|
|
500
514
|
if (!isNullOrUndefined(prevNavEle)) {
|
|
501
515
|
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,33 @@ 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
|
+
return !(selectedTime >= util.getWeekFirstDate(dates[0], this.parent.activeViewOptions.firstDayOfWeek).getTime() &&
|
|
511
|
+
selectedTime <= util.addDays(util.getWeekFirstDate(dates[dates.length - 1], this.parent.activeViewOptions.firstDayOfWeek), 6).getTime());
|
|
512
|
+
}
|
|
513
|
+
return false;
|
|
492
514
|
};
|
|
493
515
|
Month.prototype.getRenderDates = function (workDays) {
|
|
494
516
|
var renderDates = [];
|
|
@@ -518,34 +540,57 @@ var Month = /** @class */ (function (_super) {
|
|
|
518
540
|
return renderDates;
|
|
519
541
|
};
|
|
520
542
|
Month.prototype.getNextPreviousDate = function (type) {
|
|
521
|
-
if (
|
|
522
|
-
|
|
543
|
+
if (this.isCustomMonth()) {
|
|
544
|
+
var dates = this.parent.getCurrentViewDates();
|
|
545
|
+
var date = util.getWeekFirstDate(type === 'next' ? dates[dates.length - 1]
|
|
546
|
+
: dates[0], this.parent.activeViewOptions.firstDayOfWeek);
|
|
547
|
+
return util.addDays(date, type === 'next' ? util.WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
|
|
548
|
+
this.parent.activeViewOptions.numberOfWeeks : util.DEFAULT_WEEKS) * util.WEEK_LENGTH);
|
|
523
549
|
}
|
|
524
550
|
else {
|
|
525
|
-
return util.addMonths(this.parent.selectedDate, -
|
|
551
|
+
return util.addMonths(this.parent.selectedDate, ((type === 'next' ? 1 : -1) * this.parent.activeViewOptions.interval));
|
|
526
552
|
}
|
|
527
553
|
};
|
|
554
|
+
Month.prototype.getStartDate = function () {
|
|
555
|
+
return this.getMonthStart(this.parent.selectedDate);
|
|
556
|
+
};
|
|
557
|
+
Month.prototype.getEndDate = function () {
|
|
558
|
+
return this.getMonthEnd(this.parent.selectedDate);
|
|
559
|
+
};
|
|
528
560
|
Month.prototype.getEndDateFromStartDate = function (start) {
|
|
529
561
|
return util.addDays(new Date(start.getTime()), 1);
|
|
530
562
|
};
|
|
531
563
|
Month.prototype.getDateRangeText = function () {
|
|
532
564
|
if (this.parent.isAdaptive || isNullOrUndefined(this.parent.activeViewOptions.dateFormat)) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
565
|
+
var startDate = this.parent.selectedDate;
|
|
566
|
+
var endDate = void 0;
|
|
567
|
+
var updateCustomRange = false;
|
|
568
|
+
if (this.isCustomMonth()) {
|
|
569
|
+
var dates = this.parent.getCurrentViewDates();
|
|
570
|
+
updateCustomRange = dates[0].getMonth() !== dates[dates.length - 1].getMonth() ||
|
|
571
|
+
dates[0].getFullYear() !== dates[dates.length - 1].getFullYear();
|
|
572
|
+
if (updateCustomRange) {
|
|
573
|
+
startDate = dates[0];
|
|
574
|
+
endDate = dates[dates.length - 1];
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
var isUpdateDateRange = (this.parent.currentView !== 'Month' || !this.isCustomMonth());
|
|
578
|
+
if (this.parent.activeViewOptions.interval > 1 && isUpdateDateRange || updateCustomRange) {
|
|
579
|
+
endDate = endDate ? endDate : util.addMonths(util.lastDateOfMonth(startDate), this.parent.activeViewOptions.interval - 1);
|
|
580
|
+
if (startDate.getFullYear() === endDate.getFullYear()) {
|
|
581
|
+
var monthNames = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' - ' +
|
|
537
582
|
(this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() })) +
|
|
538
583
|
this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
|
|
539
584
|
return util.capitalizeFirstWord(monthNames, 'single');
|
|
540
585
|
}
|
|
541
|
-
var text = (this.parent.globalize.formatDate(
|
|
542
|
-
|
|
586
|
+
var text = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' ' +
|
|
587
|
+
startDate.getFullYear() + ' - ' +
|
|
543
588
|
this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() }) +
|
|
544
589
|
this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
|
|
545
590
|
return util.capitalizeFirstWord(text, 'single');
|
|
546
591
|
}
|
|
547
592
|
var format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
|
|
548
|
-
return util.capitalizeFirstWord(this.parent.globalize.formatDate(
|
|
593
|
+
return util.capitalizeFirstWord(this.parent.globalize.formatDate(startDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
|
|
549
594
|
}
|
|
550
595
|
return this.formatDateRange(this.parent.selectedDate);
|
|
551
596
|
};
|
|
@@ -570,6 +615,10 @@ var Month = /** @class */ (function (_super) {
|
|
|
570
615
|
EventHandler.remove(contentScrollableEle, 'scroll', this.onContentScroll);
|
|
571
616
|
}
|
|
572
617
|
};
|
|
618
|
+
Month.prototype.isCustomMonth = function () {
|
|
619
|
+
return this.parent.currentView === 'Month' &&
|
|
620
|
+
(!isNullOrUndefined(this.parent.activeViewOptions.displayDate) || this.parent.activeViewOptions.numberOfWeeks > 0);
|
|
621
|
+
};
|
|
573
622
|
Month.prototype.getModuleName = function () {
|
|
574
623
|
return 'month';
|
|
575
624
|
};
|
|
@@ -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 });
|
|
@@ -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[];
|