Skip to content

Commit bcfb086

Browse files
committed
fix: time for firefox and safari browser
1 parent 7c5253e commit bcfb086

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/notion-utils/src/format-notion-date-time.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ export interface NotionDateTime {
88
}
99

1010
export const formatNotionDateTime = (datetime: NotionDateTime) => {
11-
const dateString = `${datetime.start_time || ''} ${datetime.start_date} ${
12-
datetime.time_zone || ''
13-
}`
11+
// Adding +00:00 preserve the time in UTC.
12+
const dateString = `${datetime.start_date}T${
13+
datetime.start_time || '00:00'
14+
}+00:00`
1415
return formatDate(dateString)
1516
}

0 commit comments

Comments
 (0)