Stricter datetime
validation
#266
Labels
Content-Length: 256789 | pFad | http://github.com/github/relative-time-element/issues/266
5BFetched URL: http://github.com/github/relative-time-element/issues/266
Alternative Proxies:
Uh oh!
There was an error while loading. Please reload this page.
The docs about the
datetime
attribute say:This statement is incorrect. Any value that can be passed to the
Date
constructor will work which presents a cross-browser issue because JS engines are inconsistent in which formats theirDate
constructor accept.For example, the golang default string representation only parses in v8:
Also try this fiddle in multiple browsers.
How about adding an option attribute to pass in a validation regex into the element to validate the passed dates, when present? This would at least not make this issue missable by developers who only test in Chrome.
The text was updated successfully, but these errors were encountered: