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

Possible Bug when displaying time in custom appointment template

1 Answer 40 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Enigma
Top achievements
Rank 1
Enigma asked on 23 Apr 2010, 02:40 AM
Hi,

I tried to modify the custom appointment template and used one off of the KB's on Telerik's website.  The template is

 

<AppointmentTemplate>

 

(

<asp:Literal ID="AppointmentStartTime" runat="server" Text='<%# Eval("Start", "{0:t}") %>'></asp:Literal>

 

-

 

<asp:Literal ID="AppoitmentEndTime" runat="server" Text='<%# Eval("End", "{0:t}") %>'></asp:Literal>)

 

 

<asp:Literal ID="AppointmentSubject" runat="server" Text='<%# Eval("Subject") %>'></asp:Literal>

 

 

</AppointmentTemplate>

 



I am using a timeoffset of -5.00 and everything else on the calendar works fine except for this.  The times are shows in UTC and not adjusted for selected timezone.  So basically I got an appointment showing in the calendar at 8:00am but the apppointment template says 4:00pm as start.

Regards,
Mans.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 23 Apr 2010, 12:49 PM
Hi Mans,

Please, use the following server side workaround:
protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
   {
       Literal startTime = e.Container.FindControl("AppointmentStartTime") as Literal;
       startTime.Text = e.Appointment.Start.Add(RadScheduler1.TimeZoneOffset).ToString("hh:mm tt");
       Literal endTime = e.Container.FindControl("AppointmentEndTime") as Literal;
       endTime.Text = e.Appointment.End.Add(RadScheduler1.TimeZoneOffset).ToString("hh:mm tt");
   }


Greetings,
Peter
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
Enigma
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or