Skip to content

Commit bdf5ec9

Browse files
nikgrafCopilot
andauthored
Update packages/hypergraph/src/utils/convert-property-value.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 76669d1 commit bdf5ec9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,16 @@ 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-
return new Date(property.time);
47+
const timeDate = new Date(property.time);
48+
if (!Number.isNaN(timeDate.getTime())) {
49+
return timeDate;
50+
}
4851
}
4952
if (property.string != null && property.string !== '') {
50-
return new Date(property.string);
53+
const stringDate = new Date(property.string);
54+
if (!Number.isNaN(stringDate.getTime())) {
55+
return stringDate;
56+
}
5157
}
5258
return undefined;
5359
}

0 commit comments

Comments
 (0)