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

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

2 Answers 221 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 03 Oct 2013, 03:58 PM
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" />
</telerik:RadDatePicker>

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 07 Oct 2013, 03:24 PM
Hello,

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) {
            sender.set_dateFormat("yyyyMMdd");
        }
    </script>
</telerik:RadCodeBlock>
 
<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"/>
</telerik:RadDatePicker>

Hope that helps.

 

Regards,
Konstantin Dikov
Telerik
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.
0
J
Top achievements
Rank 1
answered on 08 Oct 2013, 03:16 PM
Thanks, Konstantin! That should work okay!
Tags
Calendar
Asked by
J
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
J
Top achievements
Rank 1
Share this question
or