first_hour and last_hour problem

Hi,
I have my agenda configured like this:

scheduler.config.readonly = true;
scheduler.config.multi_day = true;
scheduler.config.full_day = true;
scheduler.config.event_duration = 35;
scheduler.config.first_hour = 9;
scheduler.config.last_hour = 33;
scheduler.locale.labels.confirm_deleting = “”;
scheduler.config.xml_date = “%Y-%m-%d %H:%i”;
scheduler.config.server_utc = true;

The reason why my last hour is 33, is that I want to have displayed a timeline starting at 9 o’clock (displayed at top), and ending at 8 o’clock (displayed at bottom).

Now, when I load events from my database (using json, I have my ovn mechanism for that, and it functions properly), and place them on agenda with scheduler.parse(myJsonObj, “json”);, events are displayed, but improperly. Actually, they are shifted 2 hours in advance, so for example, if I have an event scheduled at 10:00 AM, it is displayed on your scheduler on 12:00 o’clock.

I don’t know what is happening, do you have any idea?
Thx in advance,
Nebojsha

Furthermore, if I have an event scheduled from 05:15 AM - 06:45 AM (before 9:00 AM generally, which is set as my first_hour), it is not displayed at all. Probably this is the problem caused by first and last hour settings.

Please tell me what to do.

All the best

Hello,

Yes, such events are filtered if you use scheduler.config.first_hour option. If you want that 9:00 simply to be displayed from that start (while have 00 - 09 hours there too) you can use scheduler.config.scroll_hour = 9 option.

Unfortunately it won’t work this way and there is no other easy way to implement such behavior (as events for the next day won’t be displayed in previous column).

Best regards,
Ilya

Your comment helped me a lot !!! Thanks.

But I am still facing the problem with events shifting. My events are still positioned 2 hours in advance. Do you have some suggestions?

I am returning their times in the following format (from my ASP.NET server-side code):
start.ToString(“yyyy-MM-dd HH:mm”)

Thanks in advance,
Nebojsha

You have enabled scheduler.config.server_utc = true; option which basically says: dates of the events on server side are in the utc format and be sure to convert them to the local timezone before displaying.
Maybe you don’t need it?

Best regards,
Ilya

You are the GOD!!!