I know I can't be the only one thinking safari is the new IE, like "it has to work on safari" makes me way more sad than "it has to work on edge"

IE is default unsupported in my company

This time around I figured out that fucking safari can't work properly with dates!

new Date("2019-05-16 11:00") // won't work
new Date("2019/05/06 11:00") // will work
new Date("16/05/2019 11:00") // won't work
new Date("11/05/2019 11:00") // will work, but it's November the 5th

Ok, the last 2 bugs are due to English&American who can't understand how dates work, but still... WHY IS SAFARI THE ONLY DIFFERENT ONE?

  • 6
    Yes, safari the new shit standard
  • 1
    @norman70688 I know it exists, I'm actually starting to use it
  • 2
    Safari might be shit but I’d still take it any day over the abomination that is IE
  • 1
    When it comes to web, it's wild West to get a full date and time with only one field, you're better off implement the date in one field and the time in another(HTML 5 offers this separation of concern), this works better in my experience than having to deal with each browser managing one datetime field.
  • 6
    i just don't get why this is still an issue - there's an ISO standard for datetime for fucks sake people! if programmers don't adhere to the standards who the fuck will!?
  • 1
    @ArcaneEye Yeah! I'm using the SQL standard "yyyy-mm-dd hh:mm" for date time, but browser work differently... at least safari... on both iOS and MacOSX
  • 4
    @ZioCain I think he meant ISO8601, as in "yyyy-mm-ddThh:mmZ". AFAIK, it works on every browser.

    JS date handling in general is an abomination, regardless of browser. Just wait until you have to deal with timezones 😱

    moment.js or luxon.js will save your sanity, that and always using ISO8601 formatted times with zone offsets
  • 3
    @poly luckily enough I don't have to deal with timezones, but if I had to, I'd probably shoot myself or something like that
Add Comment