File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ export class IsoDateParts {
8
8
static getTimezoneOffset ( offset = "Z" ) {
9
9
let [ , hours = "0" , minutes = "0" ] = offset . match ( this . TIMEZONE_REGEX ) ?? [ ] ;
10
10
11
+ let sign = hours [ 0 ] === '-' ? - 1 : 1 ;
11
12
return {
12
13
hours : parseInt ( hours , 10 ) ,
13
- minutes : parseInt ( minutes , 10 )
14
+ minutes : parseInt ( minutes , 10 ) * sign
14
15
} ;
15
16
}
16
17
Original file line number Diff line number Diff line change @@ -25,11 +25,13 @@ export const VALID_TEST_CASES = `
25
25
2016-05-25T09+01:00
26
26
2016-05-25T09:24+01:00
27
27
2016-05-25T09:24:15+01:00
28
+ 2016-05-25T09:24:15+01:15
28
29
2016-05-25T09:24:15.123+01:00
29
30
2016-05-25T09:24:15,123+01:00
30
31
2016-05-25T09-01:00
31
32
2016-05-25T09:24-01:00
32
33
2016-05-25T09:24:15-01:00
34
+ 2016-05-25T09:24:15-01:15
33
35
2016-05-25T09:24:15.123-01:00
34
36
2016-05-25T09:24:15,123-01:00
35
37
2016-05-25T09+06:00
@@ -73,8 +75,10 @@ export const VALID_TEST_CASES = `
73
75
// Issue #1
74
76
2016-05-25T09:24:15+06
75
77
2016-05-25T09:24:15+0600
78
+ 2016-05-25T09:24:15+0615
76
79
2016-05-25T09:24:15-06
77
80
2016-05-25T09:24:15-0600
81
+ 2016-05-25T09:24:15-0615
78
82
79
83
// 6 digit years
80
84
+002000-01-01
You can’t perform that action at this time.
0 commit comments