For me implementing a new library just because Safari cannot do it correctly is too much and a regex is overkill.
Here is the oneliner:
console.log (new Date('2011-04-12'.replace(/-/g, "https://stackoverflow.com/")));
More Related Contents:
- Date parsing in javascript is different between safari and chrome
- new Date(2015,2,30) and new Date(‘2015-2-30’)
- How do I format a date in JavaScript?
- Calculate age given the birth date in the format YYYYMMDD
- How do I get the difference between two Dates in JavaScript?
- Convert UTC Epoch to local date
- How to validate date with format “mm/dd/yyyy” in JavaScript?
- How to subtract date/time in JavaScript? [duplicate]
- Safari 3rd party cookie iframe trick no longer working?
- Compare two dates with JavaScript
- onClick not working on mobile (touch)
- Get time of specific timezone [duplicate]
- Setting cross-domain cookies in Safari
- Function to convert timestamp to human date in javascript [duplicate]
- How do I calculate how many seconds between two dates?
- javascript Date timezone issue
- Get the current year in JavaScript
- Get week of the month
- Convert normal date to unix timestamp
- why does javascript getMonth count from 0 and getDate count from 1?
- JS – Mobile – Open Safari from any browser [closed]
- Javascript countdown using absolute timezone?
- Why does Javascript getYear() return a three digit number?
- Date.toISOString() but local time instead of UTC
- Elegant method to generate array of random dates within two dates
- Javascript date parsing on Iphone
- create javascript date UTC
- Javascript Date Plus 2 Weeks (14 days)
- What to use instead of FileReader for Safari?
- Making a live clock in javascript