Skip to content

Commit 4f8cd79

Browse files
committed
Only check for valid ISO if value's not null
1 parent 2e3b641 commit 4f8cd79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DataSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class DataSource extends DataSourceApi<JsonApiQuery, JsonApiDataSourceOpt
139139
*/
140140
export const detectFieldType = (values: any[]): [FieldType, any[]] => {
141141
// If all values are valid ISO 8601, the assume that it's a time field.
142-
const isValidISO = values.every(value => value.length >= 10 && isValid(parseISO(value)));
142+
const isValidISO = values.filter(value => value).every(value => value.length >= 10 && isValid(parseISO(value)));
143143
if (isValidISO) {
144144
return [FieldType.time, values.map(_ => parseISO(_).valueOf())];
145145
}

0 commit comments

Comments
 (0)