From c2dfc42899eaa8110e533ba9e09ea7b0fe5308aa Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 3 Aug 2023 16:29:29 -0700 Subject: [PATCH] enh: rename to saturday sunday Signed-off-by: Christopher Ng --- apps/files_reminders/src/shared/utils.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/files_reminders/src/shared/utils.ts b/apps/files_reminders/src/shared/utils.ts index cb2beeb9215..41b252a3910 100644 --- a/apps/files_reminders/src/shared/utils.ts +++ b/apps/files_reminders/src/shared/utils.ts @@ -51,28 +51,28 @@ export const getDateTime = (dateTime: DateTimePreset): Date => { [DateTimePreset.ThisWeekend]: () => { const today = moment() - const weekendFirstDay = moment() + const saturday = moment() .startOf('isoWeek') .add(5, 'day') .add(9, 'hour') - const weekendSecondDay = moment() + const sunday = moment() .startOf('isoWeek') .add(6, 'day') .add(9, 'hour') - if (today.isSame(weekendFirstDay, 'date')) { - return weekendFirstDay + if (today.isSame(saturday, 'date')) { + return saturday .add(1, 'day') .toDate() } - if (today.isSame(weekendSecondDay, 'date')) { - return weekendSecondDay + if (today.isSame(sunday, 'date')) { + return sunday .add(1, 'week') .startOf('isoWeek') .add(5, 'day') .add(9, 'hour') .toDate() } - return weekendFirstDay.toDate() + return saturday.toDate() }, [DateTimePreset.NextWeek]: () => { -- 2.39.5