12 hour dateformat

7 posts, 0 answers
  1. Vanitha
    Vanitha avatar
    6 posts
    Member since:
    Jul 2008

    Posted 26 Sep 2008 Link to this post

    Hi,

    I am using 'RadControls for ASPNet AJAX Q2 2008'.

    I have a RadDateInput control in my form as follows:

    <TelerikWeb:RadDateInput ID="tbxTicketDate" runat="server" Width="150"   
    ToolTip="Date of Ticket"  Skin="Vista" DateFormat="M/d/yyyy h:mm tt"    
     DisplayDateFormat="M/d/yyyy h:mm tt" MaxDate="2050-01-01"   
    MinDate="2007-05-09" TabIndex="70" SelectionOnFocus="SelectAll" /> 

    The field converts information in the following manner:
    Input “082308 1000p” Becomes: “08/23/2008 10:00 AM”
    Input “080908 1245p” Becomes: “08/09/2008 12:45 AM”

    It is not considering my a/p designator, always taking as 24 hour format.

    I want the following results on my control:
    Input “082308 1045a” Convert to “08/23/2008 10:45 AM”
    Input “090808 0355p” Convert to “09/08/08 3:55 PM”

    I would appreciate any help I can get with this.

    -Vishal
  2. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 26 Sep 2008 Link to this post

    Hello Vanitha,

    You can modify the way RadDateInput interprets the entered data as shown below:
    <script language="javascript" type="text/javascript"
    function ValueChanging(sender, eventArgs) 
        var value = eventArgs.get_newValue(); 
        //modify the string to comply with your requirements 
        eventArgs.set_newValue(value); 
    </script> 

    <telerik:RadDateInput ID="tbxTicketDate" runat="server" Width="150" ToolTip="Date of Ticket" 
        Skin="Vista" DateFormat="M/d/yyyy h:mm tt" DisplayDateFormat="M/d/yyyy h:mm tt" 
        MaxDate="2050-01-01" MinDate="2007-05-09" TabIndex="70" SelectionOnFocus="SelectAll" 
        ClientEvents-OnValueChanging="ValueChanging" /> 

    Kind regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vanitha
    Vanitha avatar
    6 posts
    Member since:
    Jul 2008

    Posted 26 Sep 2008 Link to this post

    Hello Daniel,

    Thanks for your immediate response.

    Your suggestion doesn't work for me. Still it is considering as 24 hour format.

    -Vishal
  5. Shane Milton
    Shane Milton avatar
    219 posts
    Member since:
    Dec 2003

    Posted 26 Sep 2008 Link to this post

    I work with Vanitha and have looked at what she's doing. It's not a simple case of "p" being interpreted correctly. This example may explain more of the problem she's encountering:$0$0$0$0If we input: "09082008 315 pm", it gets converted into "9/8/2008 3:15 AM". For some reason, it is completely neglecting the "pm" portion of this although it seems to be a very valid and obvious input.$0$0$0$0$0-Shane$0
  6. Plamen Peshev
    Admin
    Plamen Peshev avatar
    886 posts

    Posted 29 Sep 2008 Link to this post

    Hi,


    To see more information on the requested functionality, please refer to the following article:

    Formatting Dates


    Sincerely yours,
    Plamen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Vanitha
    Vanitha avatar
    6 posts
    Member since:
    Jul 2008

    Posted 29 Sep 2008 Link to this post

    Hi,

    I did refered to this article before starting my discussion thread. Format pattern is not working as displayed in this article, i.e "M/d/yyyy h:mm tt"

    Please post sample application which satisfies my requirement.

     -Vishal

  8. Plamen Peshev
    Admin
    Plamen Peshev avatar
    886 posts

    Posted 30 Sep 2008 Link to this post

    Hello Vanitha,

    We have addressed your question in the support ticket you have opened on the same topic.

    Kind regards,
    Plamen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017