So I’ve noticed that one of my calendar events is not working properly, and it seems that for this particular event only, the “args.event.start” value is not what I would expect.
First of all, I’ve set up a test page to look at here:
https://app.benjicare.com/test.php
It’s a simplified version of my code but it serves the purpose.
If you debug the following part:
onEventClick: function (args, inst) {
var scheduleid = args.event.Id;
var scheduleUTCdate = args.event.start;
var year = scheduleUTCdate.getFullYear();
var month = scheduleUTCdate.getMonth() + 1;
var day = scheduleUTCdate.getDate();
var scheduledate = year + '-' + padLeft(month,2) + '-' + padLeft(day,2);
viewSchedule(scheduleid,scheduledate);
You’ll find that if you click on the first event, args.event.start is returned as
"2022-06-09T08:40:00"
But if you click on the second event, args.event.start is returned as a UTC object, as I would expect. I obviously need that code to behave consistently, so why is my first event returning an ISO formatted date string? Is this a bug in mobiscroll? Or am I doing something wrong?
EDIT: To see what I mean, please navigate to June 9th, 2022 to see the two events.