diff --git a/src/utils.ts b/src/utils.ts index a783d2d0..c1db09f2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -15,7 +15,7 @@ import tmp from "tmp"; * @returns {Number} */ export function convertDelayStringToMS(str) { - const regex = /^([0-9]+)\s*([dhms])?[a-z]*\s*/; + const regex = /^([0-9]+)\s*([wdhms])?[a-z]*\s*/; let match; let ms = 0; @@ -23,7 +23,8 @@ export function convertDelayStringToMS(str) { // tslint:disable-next-line while (str !== "" && (match = str.match(regex)) !== null) { - if (match[2] === "d") ms += match[1] * 1000 * 60 * 60 * 24; + if (match[2] === "w") ms += match[1] * 1000 * 60 * 60 * 24 * 7; + else if (match[2] === "d") ms += match[1] * 1000 * 60 * 60 * 24; else if (match[2] === "h") ms += match[1] * 1000 * 60 * 60; else if (match[2] === "s") ms += match[1] * 1000; else if (match[2] === "m" || !match[2]) ms += match[1] * 1000 * 60;