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

RadTimePicker - different behaviour in different system.

5 Answers 77 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Debashis Pyne
Top achievements
Rank 1
Debashis Pyne asked on 16 Sep 2011, 08:11 AM

Hi all,
In my RadTimePicker I want to show time in 24 hour format. I gone thourgh some of the threads of your site and wrote my code in the following way -

 

<telerik:RadTimePicker ID="RadTimePicker1" runat="server"  SharedTimeViewID="sharedTimeView" 
    Width="100px" Skin="WebBlue" DateInput-DateFormat="HH:mm" 
    DateInput-DisplayDateFormat="HH:mm" TimeView-TimeFormat="HH:mm" >                                   
</telerik:RadTimePicker>

It is working fine in my development environment. But when I deployed this code in our local test environment, it is not showing data is as should show. The input field (textbox) is showinig time in 24 hour format but the popup is showing in 12 hour format. Please check the attached image for your reference. Both the development system and test system are using same dll.

Why it is behaving like this? Am I missing someting? Any Idea?

5 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 21 Sep 2011, 09:11 AM
Hello Debashis Pyne,

Note that you are setting the TimeView-TimeFormat="HH:mm" property, but are using a shared TimeView component (through SharedTimeViewID="sharedTimeView"). The RadTimePicker.TimeView property references the build-in RadTimeView component, not the shared time view. You need to set the same TimeFormat property to the shared RadTimeView to see the changes.

Veli
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
Diana
Top achievements
Rank 1
answered on 13 Mar 2013, 05:35 AM
Hi,

I have the same exact setup and I did as you suggested, that is set the property to the SharedTimeView, however it didn't work. It still shows AM/PM but when the user chooses a value it gets displayed in 24 hour format. Ideas?
0
Vasil
Telerik team
answered on 13 Mar 2013, 08:00 AM
Hi Diana,

The code below is working for me:
<telerik:RadTimePicker ID="RadTimePicker1" runat="server"
    SharedTimeViewID="sharedTimeView" DateInput-DateFormat="HH:mm">
</telerik:RadTimePicker>
<telerik:RadTimeView runat="server" ID="sharedTimeView" TimeFormat="HH:mm"></telerik:RadTimeView>


Regards,
Vasil
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
Diana
Top achievements
Rank 1
answered on 13 Mar 2013, 09:43 AM
Hi Vasil,

I applied what you suggested, as below, but it's now showing and saving in the 12 hour format! I need it to both show and save the time in 24-hour format. My code is below and I am attaching a screenshot. Can you please advise? 
<rad:RadTimeView ID="SharedTimeView" runat="server" RenderMode="Lightweight" DateInput-DateFormat="HH:mm"></rad:RadTimeView>
<rad:RadTimePicker ID="tpASNDate" runat="server" SharedTimeViewID="SharedTimeView" Width="70px" RenderMode="Lightweight" DateInput-ClientEvents-OnError="InvalidTimeError" TimeFormat="HH:mm"></rad:RadTimePicker>
0
Diana
Top achievements
Rank 1
answered on 14 Mar 2013, 08:49 AM
Thank you. Actually it worked for me!
Tags
Calendar
Asked by
Debashis Pyne
Top achievements
Rank 1
Answers by
Veli
Telerik team
Diana
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or