From 06c16666de183bead2e5a7031a9112faf7179a03 Mon Sep 17 00:00:00 2001 From: Andrew Makarov Date: Fri, 1 Sep 2023 16:10:13 +0400 Subject: [PATCH 1/2] Remove fix T1117245 --- js/ui/scheduler/recurrence.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/js/ui/scheduler/recurrence.js b/js/ui/scheduler/recurrence.js index 6aceaceef562..dd30b4096316 100644 --- a/js/ui/scheduler/recurrence.js +++ b/js/ui/scheduler/recurrence.js @@ -10,8 +10,6 @@ const ruleNames = ['freq', 'interval', 'byday', 'byweekno', 'byyearday', 'bymont const freqNames = ['DAILY', 'WEEKLY', 'MONTHLY', 'YEARLY', 'SECONDLY', 'MINUTELY', 'HOURLY']; const days = { SU: 0, MO: 1, TU: 2, WE: 3, TH: 4, FR: 5, SA: 6 }; const loggedWarnings = []; -const MS_IN_HOUR = 1000 * 60 * 60; -const MS_IN_DAY = MS_IN_HOUR * 24; let recurrence = null; @@ -43,12 +41,17 @@ class RecurrenceProcessor { rruleIntervalParams.startIntervalDate, rule.until); + const t = this.rRuleSet.between( + rruleIntervalParams.minViewDate, + rruleIntervalParams.maxViewDate, + true + ); + return this.rRuleSet.between( rruleIntervalParams.minViewDate, rruleIntervalParams.maxViewDate, true - ) - .filter((date) => date.getTime() + rruleIntervalParams.appointmentDuration >= rruleIntervalParams.minViewTime) + ).filter((date) => date.getTime() + rruleIntervalParams.appointmentDuration >= rruleIntervalParams.minViewTime) .map((date) => this._convertRruleResult(rruleIntervalParams, options, date)); } @@ -85,14 +88,9 @@ class RecurrenceProcessor { _convertRruleResult(rruleIntervalParams, options, rruleDate) { const localTimezoneOffset = timeZoneUtils.getClientTimezoneOffset(rruleDate); - // NOTE: Workaround for the RRule bug with timezones greater than GMT+12 (e.g. Apia Standard Time GMT+13) - // GitHub issue: https://github.com/jakubroztocil/rrule/issues/555 - const additionalWorkaroundOffsetForRrule = - localTimezoneOffset / MS_IN_HOUR <= -13 ? -MS_IN_DAY : 0; const convertedBackDate = timeZoneUtils.setOffsetsToDate( rruleDate, [ localTimezoneOffset, - additionalWorkaroundOffsetForRrule, -options.appointmentTimezoneOffset, rruleIntervalParams.startIntervalDateDSTShift, ]); From 8548dbd4ac87c4df9ef8afafdd12c56cfa600fee Mon Sep 17 00:00:00 2001 From: Andrew Makarov Date: Fri, 1 Sep 2023 16:47:03 +0400 Subject: [PATCH 2/2] Remove mistake --- js/ui/scheduler/recurrence.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/js/ui/scheduler/recurrence.js b/js/ui/scheduler/recurrence.js index dd30b4096316..b03b13f4952a 100644 --- a/js/ui/scheduler/recurrence.js +++ b/js/ui/scheduler/recurrence.js @@ -41,12 +41,6 @@ class RecurrenceProcessor { rruleIntervalParams.startIntervalDate, rule.until); - const t = this.rRuleSet.between( - rruleIntervalParams.minViewDate, - rruleIntervalParams.maxViewDate, - true - ); - return this.rRuleSet.between( rruleIntervalParams.minViewDate, rruleIntervalParams.maxViewDate,