mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 00:03:09 +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];
|
const next = workingHours[nextIndex];
|
||||||
let then = now.add(nextIndex - now.day(), 'day');
|
let then = now.add(nextIndex - now.day(), 'day');
|
||||||
if (nextIndex <= now.day()) then = then.add(1, 'week');
|
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({
|
await channel.send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new ExtendedEmbedBuilder()
|
new ExtendedEmbedBuilder()
|
||||||
@ -725,7 +725,7 @@ module.exports = class TicketManager {
|
|||||||
}
|
}
|
||||||
} else if (now.isBefore(start)) { // staff haven't started working yet
|
} else if (now.isBefore(start)) { // staff haven't started working yet
|
||||||
working = false;
|
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({
|
await channel.send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new ExtendedEmbedBuilder()
|
new ExtendedEmbedBuilder()
|
||||||
|
Loading…
Reference in New Issue
Block a user