Skip to content

Commit 172fcaf

Browse files
committed
fix date parsing
1 parent bdf5ec9 commit 172fcaf

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

packages/hypergraph/src/utils/convert-property-value.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,10 @@ export const convertPropertyValue = (
4444
if (propertyType.value === 'date') {
4545
// Handle case where date is stored as string in the API
4646
if (property.time != null) {
47-
const timeDate = new Date(property.time);
48-
if (!Number.isNaN(timeDate.getTime())) {
49-
return timeDate;
50-
}
51-
}
52-
if (property.string != null && property.string !== '') {
53-
const stringDate = new Date(property.string);
54-
if (!Number.isNaN(stringDate.getTime())) {
55-
return stringDate;
56-
}
47+
return property.time;
48+
}
49+
if (property.string != null) {
50+
return property.time;
5751
}
5852
return undefined;
5953
}

0 commit comments

Comments
 (0)