From b0f957c0fc53b039736efc1705235dcba8a8af11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Sun, 24 Jun 2018 14:00:45 +0200 Subject: [PATCH] Fix countdown --- apps/schedule/src/app/pipes/getdatetime.pipe.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/schedule/src/app/pipes/getdatetime.pipe.ts b/apps/schedule/src/app/pipes/getdatetime.pipe.ts index 703ea05..e0a142c 100644 --- a/apps/schedule/src/app/pipes/getdatetime.pipe.ts +++ b/apps/schedule/src/app/pipes/getdatetime.pipe.ts @@ -14,12 +14,11 @@ export class GetDateTimePipe implements PipeTransform { transform(slot: Slot): Date { let result = new Date(); let day = WEEKDAYS.indexOf(slot.label.toLowerCase()); + result.setUTCHours(0, 0, 0, 0); result.setDate(result.getDate() + day - result.getDay()); let remainder = slot.offset % 60; result.setUTCHours(slot.hours - (slot.offset - remainder) / 60 >> 0); result.setUTCMinutes(slot.minutes - remainder); - result.setUTCSeconds(0); - result.setUTCMilliseconds(0); if (result.getTime() < Date.now()) { result.setDate(result.getDate() + 7); }