CoreInput form error adding

This commit is contained in:
IDONTSUDO 2024-04-12 20:43:36 +03:00
parent 27763fc8d2
commit c10cdb8158
6 changed files with 45 additions and 23 deletions

View file

@ -25,6 +25,7 @@ declare global {
fromArray(): number[];
toPx(): string;
unixFromDate(): string;
isValid(str: string): boolean;
}
interface String {

View file

@ -18,4 +18,10 @@ export const NumberExtensions = () => {
return `${date.getUTCFullYear()}.${date.getMonth()}.${date.getDay()} ${date.getHours()}:${date.getMinutes()}`;
};
}
if (Number().isValid === undefined) {
// eslint-disable-next-line no-extend-native
Number.prototype.isValid = function (str: string) {
return !isNaN(Number(str));
};
}
};