Why doesn't "yyyyMMdd" work as a date format?

3 posts, 1 answers
  1. J
    J avatar
    30 posts
    Member since:
    Oct 2012

    Posted 03 Oct 2013 Link to this post

    I've got my DatePicker (and calendar and input), but it doesn't work with this "yyyyMMdd" format. It works with spaces or characters between, but not all together. Why not? When I try to use this format and pick a date from the calendar, the input part gives me the little warning sign. Some relevant code:

    <telerik:RadCalendar runat="server" ID="RadCalendar"/>
    <telerik:RadDatePicker runat="server" ID="rdpRequestDate" SharedCalendarID="RadCalendar">>
          <DateInput DateFormat="yyyyMMdd" DisplayDateFormat="yyyyMMdd" />
  2. Answer
    Konstantin Dikov
    Konstantin Dikov avatar
    1744 posts

    Posted 07 Oct 2013 Link to this post


    With the current implementation of RadDatePicker you will not be able to set the DateFormat to "yyyyMMdd" directly. Nevertheless, you could try the following workaround that will allow you to use "yyyyMMdd" as DateFormat:
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function setDateFormat(sender, args) {
    <telerik:RadCalendar runat="server" ID="RadCalendar1"/>
    <telerik:RadDatePicker runat="server" ID="rdpRequestDate" SharedCalendarID="RadCalendar1">
        <DateInput runat="server" DateFormat="yyyy MM dd" DisplayDateFormat="yyyyMMdd" ClientEvents-OnLoad="setDateFormat"/>

    Hope that helps.


    Konstantin Dikov
    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 the blog feed now.
  3. DevCraft R3 2016 release webinar banner
  4. J
    J avatar
    30 posts
    Member since:
    Oct 2012

    Posted 08 Oct 2013 Link to this post

    Thanks, Konstantin! That should work okay!
Back to Top