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

How to force 12 hour clock

2 Answers 151 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kevon Hayes
Top achievements
Rank 1
Kevon Hayes asked on 17 Apr 2012, 04:05 PM
Is there a property to force a 12 hour clock for the RadScheduler... when I select the times for the event from the Start Time and End Time dropdowns it displays 24 hour clock times.  I'd like this to be 12 hour clock only.

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 18 Apr 2012, 10:52 AM
Hi Kevon,

 
You can set the time format in the FormCreated event of RadScheduler as in the code:

protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
   {
       if ((e.Container.Mode == SchedulerFormMode.AdvancedEdit) || (e.Container.Mode == SchedulerFormMode.AdvancedInsert))
       {
           RadTimePicker startTime = e.Container.FindControl("StartTime") as RadTimePicker;
           startTime.TimeView.TimeFormat = "hh:mm tt";
           startTime.TimeView.DataList.DataSource = null;
           startTime.DataBind();
           RadTimePicker endTime = e.Container.FindControl("EndTime") as RadTimePicker;
           endTime.TimeView.TimeFormat = "hh:mm tt";
           endTime.TimeView.DataList.DataSource = null;
           endTime.DataBind();
       }
   }

Hope this will be helpful.

All the best,
Plamen Zdravkov
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.
0
Alec
Top achievements
Rank 1
answered on 21 Jan 2013, 10:11 AM
Hello Kevon,

You can try the below code property as well to set the 12 hour format.



 <telerik:RadTimePicker ID="TPEndTime" runat="server">
          <TimeView ID="TimeView1" TimeFormat="hh:mm tt" Interval="00:30" Columns="4" runat="server" />
</telerik:RadTimePicker>

TimeFormat="hh:mm tt"   == small hh used to show the, 12 hours format with AM /PM

TimeFormat="HH:mm tt"  == CAPITAL HH used to show the miltary time, 24 hour format.

Thanks
Alec
Tags
Scheduler
Asked by
Kevon Hayes
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Alec
Top achievements
Rank 1
Share this question
or