RadDatepicker dateformat not working

2 posts, 0 answers
  1. Basharat
    Basharat avatar
    8 posts
    Member since:
    Dec 2012

    Posted 26 Feb 2013 Link to this post

    Hi I am setting the properties of RadDatepicker as follows:

     <telerik:RadDatePicker ID="rdpCommunicationDate" runat="server" SelectedDate='<%# rdpCommunicationDate.MaxDate.AddDays(-1) %>'
                                    EnableEmbeddedScripts="true" >
                                    <DateInput MinDate="01/01/1000" MaxDate="12/31/3000" DisplayDateFormat="MMMM dd yyyy" DateFormat="dd/MM/yyyy" EmptyMessage="YYYY MM DD" >
                                    </DateInput>
                                    <ClientEvents  OnDateSelected="OnDateSelected">
                            </ClientEvents>
                                </telerik:RadDatePicker>


    when I enter the date in format "yyyy MM dd" it is always taken as yyyy dd MM. Unless the month part is greater than 12 for example:
    2000 01 23.
  2. MasterChiefMasterChef
    MasterChiefMasterChef avatar
    152 posts
    Member since:
    Jan 2013

    Posted 27 Feb 2013 Link to this post

    Hi Basharat,

    In your "DateFormat" you have declared "dd/MM/yyyy", which will select the day before the month. try changing the format to "MM/dd/yyyy" (or even "MM/dd/yyyy") and it should take the first number as the Month.

    To familiarize yourself with formatting with the RadDatePicker, look at the page in documentaiton here:
    http://www.telerik.com/help/aspnet-ajax/calendar-dateinput-formatting-values.html

    Hopefully this helps,
    Master Chief
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top