Note for date parsing
See original GitHub issueHello all,
This is not a bug report, this is a heads-up message for people those run into this situation.
One of my clients recently told me that the date validations always gives error in iPhones and I started to check the reason, and it came out that date comparisons in safari need a different format than the standards accepted by other browsers.
For example yyyy-mm-dd hh:ii:ss
is not a valid format for safari. It should be formatted like yyyy-mm-dd[T]hh:ii:ss[Z]
to be accepted in all browsers.
Keep that in mind. There’s nothing to change inside the validator.js code because it’s needed to be done outside the library.
Thanks for the great library!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Date.parse() - JavaScript - MDN Web Docs
The Date.parse() method parses a string representation of a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or...
Read more >How to Use Date.parse in JavaScript - Tabnine Academy
The Date.parse() method takes as an argument a string representing a date, and returns the number of milliseconds that have elapsed between January...
Read more >Parsing a string to a date in JavaScript - Stack Overflow
The best string format for string parsing is the date ISO format together with the JavaScript Date ... Note that the number of...
Read more >Formatting and parsing date-time patterns - IBM
For parsing, if the number of pattern letters is more than two, the year is interpreted literally, regardless of the number of digits....
Read more >Learn How does Date Parsing work in JavaScript? - eduCBA
Date Parsing purpose is whenever we get data from the third party, we don't know that the given date in their documents is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also check this: https://stackoverflow.com/a/4310986/916000
Ok, but how can we ensure that the user puts in a valid formatted date for
new Date()
? Putting a compatibility table for users doesn’t seem to be a right way IMHO. Maybe an extra parameter for specifying a format would be useful but plain javascript doesn’t support that I guess. Will need a library to do the parsing. Complicated…