Opened 6 years ago

Closed 5 years ago

#17522 closed defect (duplicate)

dojo/date/stamp.fromISOString() incorrectly parses decimal fractions

Reported by: akirshin Owned by:
Priority: undecided Milestone: tbd
Component: Date Version: 1.9.1
Keywords: Cc:
Blocked By: Blocking:

Description

The regexp matches any character instead of a dot for decimal fractions. For example, it matches 2005-06-30T08:05:01-0700 (-0700 matches decimals instead of timezone)

Here is the regexp that is used: /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/ It misses backslash before dot in: (.\d+)?)

I would also suggest making the colon in the timezone optional: [+-](\d{2}):?(\d{2})

Change History (1)

comment:1 Changed 5 years ago by bill

Resolution: duplicate
Status: newclosed

Duplicate of #17315.

Note: See TracTickets for help on using tickets.