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

Scheduler Daylight savings time support

6 Answers 348 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rem
Top achievements
Rank 1
Rem asked on 09 Oct 2007, 09:10 PM
I realize that the scheduler control has a TimeZoneOffset property where I could enter the offset from UTC/GMT.  I was wondering if it had some property for DST support?

When I create an event for a date that is before daylight savings, the time zone offset works fine:  Using monthly view, double clicking on a day before daylight savings went into effect shows the appointment startdate at 00:00 am for that date and the end date is 00:00 the next day - which is correct.  However, when I double click to create an appointment on a day after daylight savings has taken effect, the appointment start date becomes 01:00 for that date, and the end date is 01:00 for the next day, which is an hour extra (due to daylight savings).

Is there a way to handle this or will we have to implement our own code?  Thanks

6 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 10 Oct 2007, 02:00 PM
Hi Rem,

Unfortunately, RadScheduler has no integrated support for DST. We have considered such support, but it is very complicated to implement. There are constant changes to the rules for the specific time zones and this information should be kept up-to-date. We are talking about 390 time zones here. We have decided that this is well outside the scope of RadScheduler and the developer should decide how to implement it. The chances are that he/she will only have to work with a limited number of time zones and the solution will not be that complex. The .NET framework itself provides basic information for the current time zone on the server.

If you need detailed information about DST in different time zones you can use a time zone library. For example, the PublicDomain library at CodePlex offers up-to-date and complete information about time zones. With this information you can alter the appointments on-the-fly.

Greetings,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
HEATHER EDWARDS
Top achievements
Rank 1
answered on 10 Oct 2007, 09:51 PM
Hi Rem,

In the schedulers load method, I do this:

 protected void RadScheduler1_Load(object sender, EventArgs e)
    {
        // Set UTC offset
        TimeZone localZone = TimeZone.CurrentTimeZone;
        TimeSpan currentOffset =  localZone.GetUtcOffset(DateTime.Today);
        this.RadScheduler1.TimeZoneOffset = currentOffset;
    }

Regards,
Matthew Hall
Halliburton
Houston, Texas
0
Rebecca Campbell
Top achievements
Rank 1
answered on 28 Oct 2009, 05:18 PM
I understand why you wouldn't want to maintain time zone information (we do it here and it's a real pain).  Have you considered adding a property that accepts a time zone rule?  Then maintenance of time zone rules still falls to the developers, but the controls can still handle the display properly.
0
T. Tsonev
Telerik team
answered on 02 Nov 2009, 11:28 AM
Hi Rebecca,

That's a very good suggestion. It'll provide this much needed functionality while still allowing us to focus on the core control development. We'll add it to our product backlog and we'll consider it for implementation in the next release.

As a token of our gratitude for your involvement, your Telerik points have been updated.

Sincerely yours,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Paul
Top achievements
Rank 1
answered on 13 Mar 2013, 08:51 PM
Hey Matthew,

I tried your code and it works fine.

TimeZone localZone = TimeZone.CurrentTimeZone;
        TimeSpan currentOffset =  localZone.GetUtcOffset(DateTime.Today);
        this.RadScheduler1.TimeZoneOffset = currentOffset;

I changed "this.RadScheduler" to reference my control's ID and It worked.

This was driving me crazy.  All "All Day" calendar events between Sunday of the start of Daylight Savings time and the end of the month (March) would not render correctly and when I would try to add new events it would create problems as well. It was also impossible for me (and my users to enter events on the first day (Sunday) of Daylight Savings Time.

For anyone else reading this, there is a caveat. Your times in your database will now be offset by the difference between your time zone and GMT (4 hours for me since I am Eastern Standard Time).  This would mean that you would need to systematically correct all events entered prior to making this change.

I still need to further testing before I decide to implement this.


Many thanks.

Paul
0
Plamen
Telerik team
answered on 15 Mar 2013, 08:56 AM
Hello Paul,

 
You can also try using TimeZoneID property as shown in this on-line demo instead.

Hope this will be helpful.

Regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Rem
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
HEATHER EDWARDS
Top achievements
Rank 1
Rebecca Campbell
Top achievements
Rank 1
Paul
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or