Skip to content

Commit 0583280

Browse files
Merge pull request NotionX#495 from s4nju/fix/time_firefox_safari
2 parents 42da5f3 + bcfb086 commit 0583280

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)