File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export class IsoDateParts {
42
42
return {
43
43
year : parseInt ( year , 10 ) ,
44
44
month : parseInt ( month , 10 ) - 1 ,
45
- day : parseInt ( day , 10 ) ,
45
+ day : parseInt ( day , 10 ) ,
46
46
hours : parseInt ( hours , 10 ) - offset . hours ,
47
47
minutes : parseInt ( minutes , 10 ) - offset . minutes ,
48
48
seconds : parseInt ( seconds , 10 ) ,
@@ -53,9 +53,11 @@ export class IsoDateParts {
53
53
54
54
static getParts ( str = "" ) {
55
55
let dateTimeMatch = str . match ( this . FULL_DATE_REGEX ) ?? str . match ( this . DATETIME_REGEX ) ;
56
- if ( ! dateTimeMatch ) throw new Error ( `Unsupported date format: ${ str } ` ) ;
56
+ if ( ! dateTimeMatch ) {
57
+ throw new Error ( `Unsupported date format: ${ str } ` ) ;
58
+ }
57
59
if ( dateTimeMatch [ 4 ] ?. match ( this . IS_FRACTIONAL_REGEX ) || dateTimeMatch [ 5 ] ?. match ( this . IS_FRACTIONAL_REGEX ) ) {
58
- throw new Error ( `Unsupported date format (fractional hours or minutes): ${ str } ` ) ;
60
+ throw new Error ( `Unsupported date format (fractional hours or minutes): ${ str } ` ) ;
59
61
}
60
62
61
63
return this . getByDateTime ( ...dateTimeMatch ) ;
You can’t perform that action at this time.
0 commit comments