Client timezone changes calendar events displayed

This seems like a strange bug. I’m using the unit view to show meetings held in rooms. I’m loading all the data via XML, and then displaying one particular day.

I discovered via a user in a substantially different timezone that if I change the timezone on the client computer, then it changes which day’s items display. It still shows them at the right time, but picks them from a different day. The time of day that I do this also affects this, so there is some kind of offset from the computer date taking place.

So, here’s an example. It’s currently 15:37 in the UK where I am, and I’m looking at a calendar with dates 15-March, 16-March, 17-March. The entries all display as I would expect. How if I change the timezone on my computer to Hawaii and refresh, I get the meetings showing a day out.

At other times of day, and with a different calendar, I might get a mix of meetings from one day and another, depending on the offset to midnight of the client timezone.

The XML data is loaded with the line:

                                     scheduler.parse(xhr.responseText);
scheduler.parse(xhr.responseText);

Where xhr.responseText is:

<data>
  <event id="2298B6AC-B61F-41A2-B58C-18904896DBD5" room_id="10" room_index="0000610" color="">
    <start_date>2016-03-17 15:00:00</start_date>
    <end_date>2016-03-17 16:30:00</end_date>
    <text>ACME Ltd</text>
  </event>
  <event id="14277B54-DCB0-45F2-9E25-EA98649A5D29" room_id="39" room_index="0000939" color="">
    <start_date>2016-03-14 12:45:00</start_date>
    <end_date>2016-03-14 14:30:00</end_date>
    <text>dsadsa</text>
  </event>
  <event id="5F0F5541-96BA-4EAF-8993-6BD760D2FB64" room_id="10" room_index="0000610" color="#006600">
    <start_date>2016-03-16 08:15:00</start_date>
    <end_date>2016-03-16 09:30:00</end_date>
    <text>bob</text>
  </event>
  <event id="78BE4B9F-987E-4D9D-A1C0-9E9AC1535E3E" room_id="9" room_index="000059" color="#FF80FF">
    <start_date>2016-03-16 10:00:00</start_date>
    <end_date>2016-03-16 11:00:00</end_date>
    <text>bobbob</text>
  </event>
  <event id="8F115EDC-2507-4C0C-9819-C9B8C1DF10E2" room_id="9" room_index="000059" color="">
    <start_date>2016-03-14 12:45:00</start_date>
    <end_date>2016-03-14 13:45:00</end_date>
    <text>My meeting</text>
  </event>
  <event id="1FADA2A7-670E-41A3-9D92-60D3B2B129BF" room_id="10" room_index="0000610" color="#80FF80">
    <start_date>2016-03-17 12:00:00</start_date>
    <end_date>2016-03-17 14:30:00</end_date>
    <text>ALGSS</text>
  </event>
  <event id="D0CEB5B9-EB64-40CD-990F-5648F506DE12" room_id="39" room_index="0000939" color="">
    <start_date>2016-03-15 09:00:00</start_date>
    <end_date>2016-03-15 09:45:00</end_date>
    <text>dsasa</text>
  </event>
  <event id="12F7ECE2-3F03-485C-A421-C786E8823864" room_id="9" room_index="000059" color="">
    <start_date>2016-03-15 10:45:00</start_date>
    <end_date>2016-03-15 12:15:00</end_date>
    <text>dsada</text>
  </event>
  <event id="AC7F6DB3-719C-42FE-AFCA-53907C49DF06" room_id="9" room_index="000059" color="">
    <start_date>2016-03-14 08:15:00</start_date>
    <end_date>2016-03-14 09:30:00</end_date>
    <text>dsada</text>
  </event>
  <event id="AEA56735-9ECD-42A5-9AF1-81F80C87F53F" room_id="39" room_index="0000939" color="#FF80FF">
    <start_date>2016-03-16 08:30:00</start_date>
    <end_date>2016-03-16 10:30:00</end_date>
    <text>benbenben</text>
  </event>
  <event id="DEB27F63-0603-4ED0-8CE5-D4E71EF52578" room_id="5" room_index="000015" color="">
    <start_date>2016-03-17 08:00:00</start_date>
    <end_date>2016-03-17 09:00:00</end_date>
    <text>ordinate</text>
  </event>
  <event id="4437CBC1-1ADA-44AD-BC0D-A79C6405355A" room_id="8" room_index="000048" color="">
    <start_date>2016-03-14 09:45:00</start_date>
    <end_date>2016-03-14 11:45:00</end_date>
    <text>UIOUIOU</text>
  </event>
  <event id="74C9DD3F-844E-451E-A8BB-0589DDD33BAC" room_id="38" room_index="0000838" color="#0000FF">
    <start_date>2016-03-15 08:15:00</start_date>
    <end_date>2016-03-15 09:30:00</end_date>
    <text>zyx</text>
  </event>
  <event id="170B4E26-AD38-4C56-BEC2-A5E99F7D9292" room_id="10" room_index="0000610" color="">
    <start_date>2016-03-17 09:00:00</start_date>
    <end_date>2016-03-17 10:00:00</end_date>
    <text>test</text>
  </event>
</data>

I’m trying to upload screenshots, but the file uploader is rejecting my jpg and png files at the moment.

Any advice?

Thanks

PC set to UK time zone:

Tuesday

Wednesday

Thursday

Switch to Hawaii time zone on PC, but identical data coming from server:

Tuesday

Wednesday

Thursday

Hi,
sorry for a long delay.
If the issue is still actual, could you please clarify what version of a scheduler do you use (4.3.x) and in which browser/OS. So far I was unable to reproduce the issue with the latest build using the xml from your initial post

Hi Aliaksandr

Yes it is still current. I think I’m using scheduler v4.3.1. This happens with any browser.

I will email you a link to a demo site (sorry I can’t post the link here it is confidential)

Hello,
I did some check and noticed that the inner property of scheduler object that holds the currently displayed date contains a string value, not a date object.
I.e. if you run following in browser console: scheduler._date

  • you should get a Date object. On your page it contains a string

I’ve found a place where the date is set (sched.js)

scheduler.updateView(ChoosePlanDate.date.value, "Location");
it should be changed to following:var parseDate = scheduler.date.str_to_date("%Y-%m-%d"); scheduler.updateView(parseDate(ChoosePlanDate.date.value), "Location");
And also scheduler initialization:

scheduler.init('scheduler_here','2016-03-17',"Location");
–>

scheduler.init('scheduler_here', new Date(2016, 2, 17),"Location");// note zero-based month

I’m not sure if that dates was causing the issue with events and timezones, but they almost surely add some non-expected behavior

Thanks for spotting that. I believe that has fixed it.