Update time length to ignore commas
This commit is contained in:
parent
ffe182e504
commit
b0407db9bb
3 changed files with 8 additions and 1 deletions
|
@ -35,4 +35,8 @@ export default class StringTools {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ReplaceAll(str: string, find: string, replace: string) {
|
||||
return str.replace(new RegExp(find, 'g'), replace);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,10 @@
|
|||
import StringTools from "./StringTools";
|
||||
|
||||
export default class TimeLengthInput {
|
||||
public readonly value: string;
|
||||
|
||||
constructor(input: string) {
|
||||
this.value = input;
|
||||
this.value = StringTools.ReplaceAll(input, ',', '');
|
||||
}
|
||||
|
||||
public GetDays(): number {
|
||||
|
|
|
@ -2,6 +2,7 @@ import { CoreClient } from "./client/client";
|
|||
import * as dotenv from "dotenv";
|
||||
import registry from "./registry";
|
||||
import { IntentsBitField } from "discord.js";
|
||||
import StringTools from "./helpers/StringTools";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
|
|
Loading…
Reference in a new issue