Update time length to ignore commas
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Ethan Lane 2023-06-19 17:49:16 +01:00
parent ffe182e504
commit b0407db9bb
3 changed files with 8 additions and 1 deletions

View file

@ -35,4 +35,8 @@ export default class StringTools {
return result; return result;
} }
public static ReplaceAll(str: string, find: string, replace: string) {
return str.replace(new RegExp(find, 'g'), replace);
}
} }

View file

@ -1,8 +1,10 @@
import StringTools from "./StringTools";
export default class TimeLengthInput { export default class TimeLengthInput {
public readonly value: string; public readonly value: string;
constructor(input: string) { constructor(input: string) {
this.value = input; this.value = StringTools.ReplaceAll(input, ',', '');
} }
public GetDays(): number { public GetDays(): number {

View file

@ -2,6 +2,7 @@ import { CoreClient } from "./client/client";
import * as dotenv from "dotenv"; import * as dotenv from "dotenv";
import registry from "./registry"; import registry from "./registry";
import { IntentsBitField } from "discord.js"; import { IntentsBitField } from "discord.js";
import StringTools from "./helpers/StringTools";
dotenv.config(); dotenv.config();