DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » Bugs » Today Navigation link not setting DayPilotCalendar to the correct date

Today Navigation link not setting DayPilotCalendar to the correct date

I've noticed that when I click the today button on the calendar header (onclick javascript event is dpc1.refreshCallBack(new Date()); that anytime after 4:00pm, it goes to the next day which is one day ahead of what it should. If I click on the button before 4:00pm, it goes to the correct day.

I'm in california and use the pacific timezone. Do I have to do some type of UTC date conversion?

Thanks

Craig

Craig - 12/19/2007 5:58:37 AM
Yes, you are correct. You should supply the time in UTC (i.e. the time on the client should always be +0000, the time zone will be added on the server).

I know that the UTC trick is a bit confusing (and moreover, the refresh(new Date()) example is not correct exactly as you point out). I would like to get rid of this and handle the time as local time on the client but IE is confusing the calculations by automatically changing to summer time zone in raw operations like Date.setTime() - in contrast to FF. Probably I will create a special wrapping Date class that will hide these problems.
Dan Letecky - 12/19/2007 8:53:49 AM

Does the control know which timezone the user is in or does it just assume the timezone that the server is set at? We have many users that are in different time zones and our application handles this outside of .net.

Craig - 12/19/2007 5:04:38 PM
DayPilot always shows the server times (or more precisely, it shows exactly the data from the database because the DateTime database field usually doesn't have the time zone information associated with it).

I'm not sure if there is a way to detect the time zone reliably in the browser (note the IE/FF differences I described above). It would be possible to add options to specify the server time zone (that can be detected automatically as well) and the client time zone (on the server side). You would have to keep the client time zone information in the user profiles and adjust DayPilot settings individually per user.
Dan Letecky - 12/19/2007 10:37:47 PM
Post reply