Skip to content

Commit 29952e5

Browse files
committed
fix date time parsing on safari
1 parent e13f2c6 commit 29952e5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tutorcruncher-socket",
3-
"version": "1.3.9",
3+
"version": "1.3.10",
44
"description": "TutorCruncher socket",
55
"author": "Samuel Colvin <[email protected]>",
66
"private": false,

src/formatting.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ const FORMAT_OPTIONS = {
3737
}
3838

3939
export function format_dt (ts, fmt) {
40-
// timestampts are alwasy in utc thus we need to add the 0000 and js will take care of the rest
41-
const d = new Date(ts + '+0000')
40+
// timestampts are always in utc thus we need to add the Z and js will take care of the rest
41+
const d = new Date(ts + 'Z')
4242
let options = FORMAT_OPTIONS[fmt]
4343
if (!options) {
4444
console.warn('unknown date format:', fmt)
45-
4645
}
4746
return Intl.DateTimeFormat(locale, options).format(d)
4847
}

0 commit comments

Comments
 (0)