I have a strange problem. I am using jQuery weekcalendar to show appointments in a calendar in the browser.
Everything is fine with Chrome. All my appointments are shown. In all other browsers, I only see the calendar, but not the appointments.
This is the link to my calendar.
Does anyone have an idea what is going on here? I don't know what code I should add to this question, as I have no idea where the problem is located. But the code is visible if you check the page source.
Your problem has to do with the way you are parsing the date coming from the ajax call 'http://www.slinder.ch/admin/php/termin_getappointments.php'. You are using "new Date()" to convert to Date. Although this is working fine in chrome, it is not working in other browsers. Try parsing your date format as explained in the following post:
How can I convert string to datetime with format specification in JavaScript?
The answer that has the following code sample seems to be sufficient and it uses the exact date format returned by the ajax call:
var dateString = "2010-08-09 01:02:03";
var reggie = /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/;
var dateArray = reggie.exec(dateString);
var dateObject = new Date(
(+dateArray[1]),
(+dateArray[2])-1, // Careful, month starts at 0!
(+dateArray[3]),
(+dateArray[4]),
(+dateArray[5]),
(+dateArray[6])
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With