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

Radtimepicker using US date format instead of localised date format

2 Answers 24 Views
TimePicker
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 25 Mar 2019, 09:27 AM

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 Answers, 1 is accepted

Sort by
0
Dinko
Telerik team
answered on 28 Mar 2019, 09:17 AM
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.
0
Dinko
Telerik team
answered on 28 Mar 2019, 01:28 PM
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.
Tags
TimePicker
Asked by
Chris
Top achievements
Rank 1
Answers by
Dinko
Telerik team
Share this question
or