From 921bdfa4476fabc16c3d9f8a9fd935afba566b25 Mon Sep 17 00:00:00 2001 From: Isaac Date: Fri, 26 May 2023 16:11:31 +0100 Subject: [PATCH] fix(working hours): invalid timestamps with timezones (closes #417) --- src/lib/tickets/manager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/tickets/manager.js b/src/lib/tickets/manager.js index 7cec820..101f4a8 100644 --- a/src/lib/tickets/manager.js +++ b/src/lib/tickets/manager.js @@ -713,7 +713,7 @@ module.exports = class TicketManager { const next = workingHours[nextIndex]; let then = now.add(nextIndex - now.day(), 'day'); if (nextIndex <= now.day()) then = then.add(1, 'week'); - const timestamp = Math.ceil(then.time(next[0]).d.getTime() / 1000); // in seconds + const timestamp = Math.ceil(then.time(next[0]).goto('utc').d.getTime() / 1000); // in seconds await channel.send({ embeds: [ new ExtendedEmbedBuilder() @@ -725,7 +725,7 @@ module.exports = class TicketManager { } } else if (now.isBefore(start)) { // staff haven't started working yet working = false; - const timestamp = Math.ceil(start.d.getTime() / 1000); // in seconds + const timestamp = Math.ceil(start.goto('utc').d.getTime() / 1000); // in seconds await channel.send({ embeds: [ new ExtendedEmbedBuilder()