Skip to content

Commit 1a28c61

Browse files
committed
Ignore linter issue for moment
1 parent 1cfeaba commit 1a28c61

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/detectFieldType.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FieldType } from '@grafana/data';
2-
import moment from 'moment';
2+
3+
import moment from 'moment'; // eslint-disable-line no-restricted-imports
34

45
/**
56
* Detects the field type from an array of values.
@@ -13,7 +14,7 @@ export const detectFieldType = (values: any[]): FieldType => {
1314
// If all values are valid ISO 8601, then assume that it's a time field.
1415
const isValidISO = values
1516
.filter((value) => value !== null)
16-
.every((value) => moment(value, ['YYYY-MM-DD', moment.defaultFormat], true).isValid());
17+
.every((value) => moment(value, [moment.defaultFormat, 'YYYY-MM-DD'], true).isValid());
1718
if (isValidISO) {
1819
return FieldType.time;
1920
}

0 commit comments

Comments
 (0)