Radtimepicker using US date format instead of localised date format

3 posts, 0 answers
  1. Chris
    Chris avatar
    14 posts
    Member since:
    Sep 2014

    Posted 25 Mar Link to this post

    Hello,

    it seems the radtimepicker is always using the US Date format. Why is it not using the the host machine localisation ? The problem is now I can not easily convert to date time (even though only the time portion is relevant ) . Please see attached screen shot. Here in South Africa our machines are set to DD/M/YYYY plus time but the timepicker is return the full date in us format M/DD/YYYY plus time.

     

     

     

     

  2. Dinko
    Admin
    Dinko avatar
    889 posts

    Posted 28 Mar Link to this post

    Hello Chris,

    Thank you for the provided image.

    I am currently investigating this behavior. I will contact later with further information about your case.

    Regards,
    Dinko
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Dinko
    Admin
    Dinko avatar
    889 posts

    Posted 28 Mar Link to this post

    Hi Chris,

    Thank you for your patience.

    Let me first start with the looking at the attached picture the RadTimePicker control is bound to a string property. My guess is that the SelectedDate property is bound to this string LatestFor property. The SelectedDate is a DateTime? object. Binding it to a string property will ignore the current applied culture format. I have tested this on my side and was able to reproduce it.

    My recommendation is to bind the SelectedDate property to a DateTime? in order for the current date format to be applied.
    private DateTime? _LatestFor;
     
    public DateTime? LatestFor
    {
        get { return _LatestFor; }
        set {
            var defaultDateTime = value;    
            _LatestFor = value;
            this.OnPropertyChanged("LatestFor"); }
    }

    Give this approach a try and let me know if it is applicable in your main application.

    Regards,
    Dinko
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top