Skip to content

Commit a37ef3b

Browse files
ezraodio1Ezra Odio
andauthored
Fixed frontend test deprecation warnings (#7013)
Created Moment in ISO 8601 format instead of using the default Date() constructor. Co-authored-by: Ezra Odio <[email protected]>
1 parent 0056aa6 commit a37ef3b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

client/app/services/parameters/DateParameter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class DateParameter extends Parameter {
6161
return value;
6262
}
6363

64-
const normalizedValue = moment(value);
64+
const normalizedValue = moment(value, moment.ISO_8601, true);
6565
return normalizedValue.isValid() ? normalizedValue : null;
6666
}
6767

client/app/services/query-result.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function fetchDataFromJob(jobId, interval = 1000) {
114114
}
115115

116116
export function isDateTime(v) {
117-
return isString(v) && moment(v).isValid() && /^\d{4}-\d{2}-\d{2}T/.test(v);
117+
return isString(v) && moment(v, moment.ISO_8601, true).isValid() && /^\d{4}-\d{2}-\d{2}T/.test(v);
118118
}
119119

120120
class QueryResult {

0 commit comments

Comments
 (0)