Closed BrendanTCC closed 6 months ago
Will add a feature to automatically detect Daylight savings time in Australia and adjust the time difference accordingly
You can get a time string for the Adelaide time zone with the built-in Date
object.
const d = new Date();
var timeString = d.toLocaleTimeString("en-AU", {hour: "2-digit", minute: "2-digit", timeZone: "Australia/Adelaide"});
// 12 hour time in Adelaide (e.g. "04:05 am", "04:05 pm", "12:30 am")
var timeString24 = d.toLocaleTimeString("en-AU", {hour: "2-digit", minute: "2-digit", timeZone: "Australia/Adelaide", hourCycle: "h23"});
// 24 hour time in Adelaide (e.g. "04:05", "16:05", "00:30")
Perhaps not ideal if we want to keep everything in actual time objects for something like bringing back the "goobin' time" text, but parsing the resulting string wouldn't be difficult. Otherwise we would probably want to add a time library like day.js, because it's a bit tricky to work with time zones, especially time zones with DST, using just Date
s (as this issue proves).
that actually sounds good, I probably wont be bringing back the banner text, since that was basically replaced with discord events. but if you want to implement that for me that would be great, otherwise ill find the time to do it
You forgot to remove all references of calcTime
function, causing an exception, fixing now
just have it delete /
with --no-preserve-root
and you're good
(i kid)
At the time of this writing the banner shows 19:24 when it should be showing 18:24.
If it helps with writing automation in: DST begins at 02:00 on the first Sunday of October, and finishes at 03:00 on the first Sunday of April the following year.