Skip to content

Commit 56acfac

Browse files
committed
These regexes are no longer needed!
1 parent 2398c8d commit 56acfac

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

parse.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ export class IsoDateParts {
1010
static TIMEZONE_REGEX = /^([+-]\d{2})(?::?(\d{2}))?$/;
1111
static IS_FRACTIONAL_REGEX = /^\d+[\.\,]\d+$/;
1212

13-
// Unsupported formats https://en.wikipedia.org/wiki/ISO_week_date
14-
static DATE_WEEK_REGEX = /^(\d{4})-W\d{2}-?\d{0,1}/;
15-
static YEARDAY_REGEX = /^(\d{4})-?\d{3}$/;
16-
1713
static getTimezoneOffset(offset = "") {
1814
if(offset === "Z") {
1915
return this.DEFAULT_TIMEZONE_OFFSET;
@@ -46,10 +42,6 @@ export class IsoDateParts {
4642
}
4743

4844
static getParts(str) {
49-
if(str.match(this.DATE_WEEK_REGEX) || str.match(this.YEARDAY_REGEX)) {
50-
throw new Error(`Unsupported date format (unsupported syntax): ${str}`);
51-
}
52-
5345
let dateMatch = str.match(this.FULL_DATE_REGEX);
5446
if(dateMatch) {
5547
return this.getByDateTime(dateMatch);

0 commit comments

Comments
 (0)