Fixed frontend test deprecation warnings (#7013)

Created Moment in ISO 8601 format instead of using
the default Date() constructor.

Co-authored-by: Ezra Odio <eodio@starfishstorage.com>
This commit is contained in:
Ezra Odio
2024-07-08 10:29:41 -04:00
committed by GitHub
parent 0056aa68f8
commit a37ef3b235
2 changed files with 2 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ class DateParameter extends Parameter {
return value;
}
const normalizedValue = moment(value);
const normalizedValue = moment(value, moment.ISO_8601, true);
return normalizedValue.isValid() ? normalizedValue : null;
}

View File

@@ -114,7 +114,7 @@ export function fetchDataFromJob(jobId, interval = 1000) {
}
export function isDateTime(v) {
return isString(v) && moment(v).isValid() && /^\d{4}-\d{2}-\d{2}T/.test(v);
return isString(v) && moment(v, moment.ISO_8601, true).isValid() && /^\d{4}-\d{2}-\d{2}T/.test(v);
}
class QueryResult {