umer sufyan
umer sufyan

Reputation: 1035

UIDatePicker changing NSLocale Issue

Hope every body is doing great.

I just came across a strange issue, changing manually NSLocale of UIDatepicker is not working but in only specific mode

datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(10, 130, [UIScreen mainScreen].bounds.size.width-20, 120)];  

NSLocale* locale = [NSLocale localeWithLocaleIdentifier:[AppDelegate getLocale]];  

[datePicker setLocale:locale];  

datePicker.datePickerMode = UIDatePickerModeCountDownTimer;  

Now here it only returns hours and Minutes in English irrespective of Locale value, While if you set

datePicker.datePickerMode = UIDatePickerModeDate;  

Or even this

datePicker.datePickerMode = UIDatePickerModeTime;  

Is working fine

Only when you use

datePicker.datePickerMode = UIDatePickerModeCountDownTimer;

locale is not working in that case,

Is it a bug in UIDatepicker that needs to be fixed, or what is work around?

Upvotes: 0

Views: 96

Answers (1)

umer sufyan
umer sufyan

Reputation: 1035

Well i got an Email/Answer from APPle that is not possible for now, may be in future.

Thanks for contacting to Apple’s Developer Technical Support.

When running in the count down mode, UIDatePicker showns the hours and minutes to count down. In this context, the “hours” and “minutes” are not a format, thus not covered by locale; rather, they are labels describing the meaning of the numbers, which honor to the application language. Note that locale is quite different from language. See WWDC 2014 Session 201 "Advanced Topics in Internationalization” for the details.

so we have to wait for that till Apple fix that :( .

Upvotes: 1

Related Questions