File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,6 @@ class Serializer {
74
74
}
75
75
}
76
76
77
- pad2Zeros ( num ) {
78
- const s = '00' + num
79
- return s [ s . length - 2 ] + s [ s . length - 1 ]
80
- }
81
-
82
77
asAny ( i ) {
83
78
return JSON . stringify ( i )
84
79
}
@@ -148,10 +143,7 @@ class Serializer {
148
143
asTime ( date , skipQuotes ) {
149
144
const quotes = skipQuotes === true ? '' : '"'
150
145
if ( date instanceof Date ) {
151
- const hour = new Intl . DateTimeFormat ( 'en' , { hour : 'numeric' , hourCycle : 'h23' } ) . format ( date )
152
- const minute = new Intl . DateTimeFormat ( 'en' , { minute : 'numeric' } ) . format ( date )
153
- const second = new Intl . DateTimeFormat ( 'en' , { second : 'numeric' } ) . format ( date )
154
- return quotes + this . pad2Zeros ( hour ) + ':' + this . pad2Zeros ( minute ) + ':' + this . pad2Zeros ( second ) + quotes
146
+ return quotes + new Date ( date . getTime ( ) - ( date . getTimezoneOffset ( ) * 60000 ) ) . toISOString ( ) . slice ( 11 , 19 ) + quotes
155
147
} else if ( date && typeof date . format === 'function' ) {
156
148
return quotes + date . format ( 'HH:mm:ss' ) + quotes
157
149
} else {
You can’t perform that action at this time.
0 commit comments