Skip to content

Commit 5b2da6e

Browse files
committed
chore: more consistent formatting
1 parent 700dd41 commit 5b2da6e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

parse.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class IsoDateParts {
4242
return {
4343
year: parseInt(year, 10),
4444
month: parseInt(month, 10) - 1,
45-
day: parseInt(day, 10) ,
45+
day: parseInt(day, 10),
4646
hours: parseInt(hours, 10) - offset.hours,
4747
minutes: parseInt(minutes, 10) - offset.minutes,
4848
seconds: parseInt(seconds, 10),
@@ -53,9 +53,11 @@ export class IsoDateParts {
5353

5454
static getParts(str = "") {
5555
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+
}
5759
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}`);
5961
}
6062

6163
return this.getByDateTime(...dateTimeMatch);

0 commit comments

Comments
 (0)