mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-05 04:13:08 +02:00
fix(working hours): invalid timestamps with timezones (closes #417)
This commit is contained in:
parent
f07e157642
commit
921bdfa447
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user