mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user