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

DateTime issues

2 Answers 84 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jim Aderhold
Top achievements
Rank 2
Jim Aderhold asked on 14 Nov 2008, 11:27 PM
I am having some inconsistencies with Dates and Times. I am using the advanced form method and saving the results in a database. The start and end days are being saved in the database as a string which is actually the universal time. The recurring rule value is also being saved to the database as a string. When binding the data back to a Scheduler, the days that do not recur render as if I need to add a TimeZoneOffset whereas the recurring appointments render just fine. So if I add a TimeZoneOffSet, then the non-recurring days will render correctly, but the recurring days will now be off.

The start and end format match with the dates in the recurring data. When I go back to edit both recurring and non-recurring, the date and time are correct.

I have not added any TimeZoneOffSet values in the admin section nor on the front end.

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 17 Nov 2008, 03:35 PM
Hello Jim,

Could you please elaborate? For example, can you send us some sample strings that are stored in the data base and what you get in RadScheduler. Sample code of your implementation could also be helpful.


Best wishes,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jim Aderhold
Top achievements
Rank 2
answered on 17 Nov 2008, 05:07 PM
They way we have it setup is we are binding the RadScheduler with a list of event objects. These event objects are derived from a class that we have built out. The start and end properties for this class are string values. The Date is saved in a string format with the following format value, "yyyy-MM-ddTHH:mmZ". So a 2 PM appointment is being saved as "2008-11-14T14:00Z".

I found the problem was how I was binding the data. We were creating a method that returned a list of event objects. This method was being bound to the RadScheulder through the DataSource property. This is where the fault was at. I was not transforming the data from the DB before binding it to the RadScheduler. The recurring rule was handled just fine. It was just the start and end dates on a non-recurring event. After a few days away from this, I thought about creating my own provider that would transform the data before binding it. So I create a class that inherits from the SchedulerProviderBase and in the GetAppointments method, I got my list of event objects, transformed the data and then added it to the appointment collection. This has fixed the problem I was having.

Thanks
Tags
Scheduler
Asked by
Jim Aderhold
Top achievements
Rank 2
Answers by
Peter
Telerik team
Jim Aderhold
Top achievements
Rank 2
Share this question
or