Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date parsing in Safari prevents passing a default-time by the directive #221

Closed
djuerges opened this issue Apr 6, 2018 · 0 comments
Closed

Comments

@djuerges
Copy link

djuerges commented Apr 6, 2018

There is a difference in date parsing between Safari and other browsers.

https://stackoverflow.com/questions/6427204/date-parsing-in-javascript-is-different-between-safari-and-chrome#6427318

Setting a default-time by argument of the directive will lead to an invalid date exception in 2.6.1 line 367 on parsing the date with the added default time:

var t = new Date('2001-01-01 ' + defaultTime);

screen shot 2018-04-06 at 11 21 26

However if you see https://stackoverflow.com/questions/4310953/invalid-date-in-safari there is a simple fix for it:

new Date('2001/01/01 ' + defaultTime)
will output to
Mon Jan 01 2001 12:00:00 GMT+0100 (CET)

If the problem persist on other parts of the code as well, there is a more general approach to use .replace(/-/g, "/"). But I haven't found any other occurrence yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants