RadDatePicker custom input format

2 posts, 1 answers
  1. Ziga HABJAN
    Ziga HABJAN avatar
    22 posts
    Member since:
    Jan 2004

    Posted 10 Jun 2013 Link to this post

    Hi, is it possible to config RadDatePicker to accept dates without dots:
    User would like to enter "31012013" in textbox (of RadDatePicker), that would be converted to datetime. (re-format to "31.01.2013" on blur is acceptable, but how to do it?) 

    re, Žiga
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Jun 2013 Link to this post

    Hi,
    Try this following code:

    ASPX:
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server"  >
      <DateInput ToolTip="Date input" runat="server" >
        <ClientEvents OnValueChanged="ValueChanged" />
      </DateInput>
    </telerik:RadDatePicker>

    JS:
    function ValueChanged(sender, args)
     {
     sender.set_textBoxValue(args.get_newDate().format("MM.dd.yyyy"));
     }

    Thanks
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top