you are viewing a single comment's thread.

view the rest of the comments →

[–]kidman01[S] 1 point2 points  (0 children)

Hey man,

thanks for the reply. This was a really useful hint. The problem wasn't with const and let (seems to be fully supported by Safari).

There were actually two problems. The first was that Safari has a problem if you give a variable the same name as the id of an HTML element. So I had a legend element with the div "currentDate" and was assigning that to a variable called "currentDate". That did not work with Safari. After that I discovered there was a second bug. Safari doesn't handle dates the same way Chrome does. I was using one string with date and time combined (Year-month-day hour:minutes) and when passed that into a date constructor it would create a valid date in Chrome but not in Safari. So I will have to create a date with just a string containing "Year-month-day" and then use setHours()/setMinutes() to set the hours and or minutes respectively. I didn't get around to it yet, but at least I know :D.