Date Validation on Two Digit Year

2 posts, 0 answers
  1. Satyabrata
    Satyabrata avatar
    1 posts
    Member since:
    Jan 2015

    Posted 08 Jan 2015 Link to this post

      I am facing one issue with the telerik RadDatePicker in my WPF application. I have formatted the display date with DataFormat(MM/dd/yy) so that it display two digit
    year like 01/02/20.

    Now when I entered 01/02/20 into the textbox(RadWatermarkTextBox) of RadDatePicker the dropdown showing 2nd Jan 2020. But when I entered 01/02/55, the dropdown is showing 2nd Jan 1955.
    I am not sure why it is inconsistent when I select two differnet date. I have to validate the date entered so that user can select date with in specific range.

    I can not even update the SelectedDate/DisplayDate of the DatePicker from C# code.
    Could you please help me how to establish the logic to validate the date with 2 digit year.
    Also let me knwo how to update the SelectedDate/DisplayDate of the radDatePicker.

  2. Kalin
    Kalin avatar
    1283 posts

    Posted 09 Jan 2015 Link to this post

    Hello Satyabrata,

    What I can suggest you would be to check the How to implement custom parsing article from our help documentation. It will allow to implement the required and the parse the dates as needed. However I tested the provided inputs in sample application and control parsed 01/02/55 as 2055 (please check the screenshot).

    As for the SelectedDate/DisplayDate there isn't anything spacial that needs to done in order to set them. You just need to assign new DateTime object as shown below:

    this.Picker.SelectedDate = new DateTime(2015, 5, 5);

    Can you please share more details regarding the issues you face when setting the SelectedDate/DisplayDate properties (some sample code would be helpful)?

    Hope this helps. 


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top