diff --git a/backend/src/plugins/Tags/TagsPlugin.ts b/backend/src/plugins/Tags/TagsPlugin.ts index 1d1c7c0c..c6674189 100644 --- a/backend/src/plugins/Tags/TagsPlugin.ts +++ b/backend/src/plugins/Tags/TagsPlugin.ts @@ -133,6 +133,10 @@ export const TagsPlugin = zeppelinGuildPlugin()({ return Date.now(); } + if (!Number.isNaN(Number(str))) { + return Number(str); // Unix timestamp as a string + } + return moment.tz(str, "YYYY-MM-DD HH:mm:ss", tz).valueOf(); }, @@ -156,6 +160,14 @@ export const TagsPlugin = zeppelinGuildPlugin()({ let reference; let delay; + for (const [i, arg] of args.entries()) { + if (typeof arg === "number") { + args[i] = String(arg); + } else if (typeof arg !== "string") { + args[i] = ""; + } + } + if (args.length >= 2) { // (time, delay) reference = this.parseDateTime(args[0]); @@ -175,6 +187,14 @@ export const TagsPlugin = zeppelinGuildPlugin()({ let reference; let delay; + for (const [i, arg] of args.entries()) { + if (typeof arg === "number") { + args[i] = String(arg); + } else if (typeof arg !== "string") { + args[i] = ""; + } + } + if (args.length >= 2) { // (time, delay) reference = this.parseDateTime(args[0]);