In my app, users can pick a "duration". I am using a UIDatePicker with datePickerMode set to time for this.
- In order to pick 0-24h, I set the date picker
localeto e.g.NLlike explained here. - Because I want to show the picker in a list, I use
compactfor thepreferredDatePickerStyle - In order to make it easier for the user to pick a duration, I set
minuteIntervalto5
Now, when using this on a device that has 12h time display in the iOS settings, this causes the expanded date picker to only offer hours from 1-12, instead of 0-23.
Interestingly, this problem does not occur when the device is set to 24h time display or I am using any other value for the minuteInterval (e.g. 10) or I am using a different preferredDatePickerStyle (e.g. inline)
Is this an iOS bug and is there any workaround?