9 April 2008

RadScheduler and .NET 3.5

Dear Susan,

At the moment I'm working heavily on a project that is using Telerik's superb RadScheduler. I know it's still only in BETA, but it came at just the perfect time for us and our client so we jumped on board.

This meant a 1.1 - 2.0 shift (yikes!) and AJAX thrown in too. The main issue though came up a couple of weeks ago, when - here in the UK - we moved into DST. What a nightmare!

The problem is that one of the specifications of the project requires that it be ready to accept users from any country and map all times local to them! So I spent two months rebuilding all the time functions, saving all times to UTC etc etc

Without going into all of the details of DST in different countries and how we use the data in other areas of the site, suffice to say there is no manageable way with either the Scheduler or .NET 2.0 to map DST for each and every rule save creating them yourself.

And then I stumbled upon TimeZoneInfo in the System.Core of .NET 3.5! What a God-send. Thanks to some of the simple methods in this beautiful class we have succesfully implemented a method for displaying all appointments in the Scheduler to the correct local time.

This class encapsulates Windows' built-in timezone database in the registry. I will be posting the code for adapting the Scheduler later. Basically: FORGET THE SCHEDULER'S BUILT-IN TIMEZONEOFFSET PROPERTY (i.e. set it to '00:00:00' and don't change it)

No comments: