This commit is contained in:
Lamp 2022-03-19 12:39:35 -07:00
parent 17d295043f
commit 06685d0ad4
2 changed files with 9 additions and 2 deletions

@ -25,26 +25,32 @@ module.exports = {
base_uri: "https://ldb.owo69.me",
world_clock: [
{
flag: "🇺🇸",
timezone: "America/Los_Angeles",
channel: "887897732428226660"
},
{
flag: "🇺🇸",
timezone: "America/New_York",
channel: "888507872932143155"
},
{
flag: "🇩🇪",
timezone: "Europe/Berlin",
channel: "887897886879281203"
},
{
flag: "🇷🇺",
timezone: "Europe/Moscow",
channel: "887897904738599002"
},
{
flag: "🇵🇭",
timezone: "Asia/Manila",
channel: "888505937315389451"
},
{
flag: "🇯🇵",
timezone: "Asia/Tokyo",
channel: "887897753198419999"
}

@ -5,7 +5,7 @@ client.once("ready", () => {
(function clock() {
var d = new Date();
for (let x of config.world_clock) {
let t = Intl.DateTimeFormat("en", {
let t = x.flag + ' ' + Intl.DateTimeFormat("en", {
timeZone: x.timezone,
hour: 'numeric',
//minute: 'numeric',
@ -13,9 +13,10 @@ client.once("ready", () => {
hour12: true
}).format(d);
t = t.replace(/[a-z]+(?: |$)/g, ''); // most of the abbrv are GMT+n >:(
t = t.replace("AM", "A.M.").replace("PM", "P.M.");
client.channels.resolve(x.channel)?.setName(t);
}
d.setMinutes(60);
setTimeout(clock, d - Date.now());
})();
})();
});