Fix calendar time, neopia fix

This commit is contained in:
Daniel Odendahl Jr
2018-07-08 15:16:04 +00:00
parent d60e3a5e00
commit 44d10df244
3 changed files with 8 additions and 3 deletions
+1
View File
@@ -38,6 +38,7 @@ module.exports = class HolidaysCommand extends Command {
singleEvents: true,
timeMax: tomorrow().toISOString(),
timeMin: today().toISOString(),
timeZone: 'UTC',
key: GOOGLE_KEY
});
if (!body.items.length) return null;
+6 -2
View File
@@ -22,10 +22,14 @@ module.exports = class TimeCommand extends Command {
}
run(msg, { timeZone }) {
if (timeZone === 'NEOPIA/STANDARD') timeZone = 'AMERICA/VANCOUVER';
let neopia = false;
if (timeZone === 'NEOPIA/STANDARD' || timeZone === 'NEOPIA') {
timeZone = 'AMERICA/VANCOUVER';
neopia = true;
}
try {
const time = new Date().toLocaleTimeString('en-US', { timeZone });
return msg.say(`The current time in ${timeZone} is ${time}.`);
return msg.say(`The current time in ${neopia ? 'NEOPIA' : timeZone} is ${time}.`);
} catch (err) {
return msg.reply('Invalid time zone. Refer to <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>.');
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "81.0.5",
"version": "81.0.6",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {