RadTimePicker - different behaviour in different system.

6 posts, 0 answers
  1. Debashis Pyne
    Debashis Pyne avatar
    66 posts
    Member since:
    Apr 2010

    Posted 16 Sep 2011 Link to this post

    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?
  2. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 21 Sep 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Diana
    Diana avatar
    18 posts
    Member since:
    Nov 2012

    Posted 13 Mar 2013 Link to this post

    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?
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 13 Mar 2013 Link to this post

    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.
  6. Diana
    Diana avatar
    18 posts
    Member since:
    Nov 2012

    Posted 13 Mar 2013 Link to this post

    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>
  7. Diana
    Diana avatar
    18 posts
    Member since:
    Nov 2012

    Posted 14 Mar 2013 Link to this post

    Thank you. Actually it worked for me!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017