This is a migrated thread and some comments may be shown as answers.

[Solved] How to set "All day" event to persist across timezone changes?

1 Answer 97 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jeremy Mann
Top achievements
Rank 1
Jeremy Mann asked on 16 Feb 2010, 04:03 PM
Example scenario:  Headquarters office creates an AllDay event, and that particular user is in Central Standard Time.  When the employees from the Eastern or Pacific timezone offices look at the calendar the appointments do not show as "all day" but instead as a huge appointment ranging from 1:00am day of the event, to 1:00am the day after an event (times given are just an example), however all users in the CST offices see the appointment correctly.
---------------------------------------------------

The UTC correction is getting applied to these all day events, and In need to make sure that doesn't happen. I figure I can intercept this in the GetAppointments & GetAppointment events of the provider, but I'm just not sure how to apply this appropriately.

For my holidays (which works correctly) I'm using:
apt.Start = Convert.ToDateTime(holiday.StartDate).Subtract(owner.TimeZoneOffset); 
apt.End = Convert.ToDateTime(holiday.EndDate).Subtract(owner.TimeZoneOffset); 

The diffrence between my holiday data and the appointment data the users are creating is the hours.  Holidays are set as 12AM (2010-01-01 00:00:00.000) and the users are set to their timezone (e.g. 2010-01-01 06:00:00.000).  Since the hour is unpredictable based on the creating users timezone, would it be advisable to just set the what ever is in the hour (06 in the example above) to 00 ?

Does this sound like an accurate chain of events?

  1. Intercept the setting of the current date
  2. determine the time span and find if this is a 24hr event (what happens in n-day events?  72hrs, 48hrs, etc.)
  3. If it is, continue, if it's not set the existing DateTime.
  4. Set the dates hour to zero
  5. subtract the current TimeZoneOffset of the scheduler
  6. set the new value as the DateTime to use

1 Answer, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 17 Feb 2010, 07:49 AM
Hi Jeremy,

We have a KB article that demonstrates how to keep "all day" appointments consistent across time zone changes. It uses a slightly different approach to achieve the same result.

http://www.telerik.com/support/kb/aspnet-ajax/scheduler/pinning-all-day-appointments-for-different-time-zones.aspx

I hope this helps.

All the best,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Scheduler
Asked by
Jeremy Mann
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or