From 6cb44e65a6ce6d809e73be39a73f445b9368b1ba Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 4 Oct 2023 10:10:31 +0300 Subject: [PATCH] calendar week range title fix --- client/modules/crm/src/views/calendar/calendar.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/modules/crm/src/views/calendar/calendar.js b/client/modules/crm/src/views/calendar/calendar.js index a6e866610f..33cd4f269b 100644 --- a/client/modules/crm/src/views/calendar/calendar.js +++ b/client/modules/crm/src/views/calendar/calendar.js @@ -69,6 +69,7 @@ class CalendarView extends View { week: 'MMMM YYYY', day: 'dddd, MMMM D, YYYY', } + rangeSeparator = ' – ' /** @private */ fetching = false @@ -381,7 +382,12 @@ class CalendarView extends View { const format = this.titleFormat[viewName]; if (viewName === 'week') { - title = this.calendar.formatRange(view.currentStart, view.currentEnd, format); + const start = this.dateToMoment(view.currentStart).format(format); + const end = this.dateToMoment(view.currentEnd).subtract(1, 'minute').format(format); + + title = start !== end ? + start + this.rangeSeparator + end : + start; } else { title = moment(view.currentStart).format(format); } @@ -738,7 +744,7 @@ class CalendarView extends View { slotLabelFormat: slotLabelFormat, eventTimeFormat: timeFormat, initialView: this.modeViewMap[this.viewMode], - defaultRangeSeparator: ' – ', + defaultRangeSeparator: this.rangeSeparator, weekNumbers: true, weekNumberCalculation: 'ISO', editable: true,