FIX: attempts to be correct about dst when using recurrence (#8366)

This commit is contained in:
Joffrey JAFFEUX 2019-11-18 10:02:58 +01:00 committed by GitHub
parent 3bb7ad4be1
commit 45648e46ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -194,9 +194,9 @@
const type = parts[1]; const type = parts[1];
const diff = moment().diff(dateTime, type); const diff = moment().diff(dateTime, type);
const add = Math.ceil(diff + count); const add = Math.ceil(diff + count);
const wasDST = moment(dateTime.format()).isDST(); const wasDST = dateTime.isDST();
let dateTimeWithRecurrence = dateTime.add(add, type); let dateTimeWithRecurrence = dateTime.add(add, type);
const isDST = moment(dateTimeWithRecurrence.format()).isDST(); const isDST = dateTimeWithRecurrence.isDST();
if (!wasDST && isDST) { if (!wasDST && isDST) {
dateTimeWithRecurrence.subtract(1, "hour"); dateTimeWithRecurrence.subtract(1, "hour");