Search code examples
iosobjective-cuidatepicker

Change default UIDatePicker and enable it to accept 00 as day and month. like this 00-00-YYYY


I wanted to change my default UIDatePicker functionality and want to enable it to accept 00 as a valid day and month like this 00-00-YYYY. Please view the attached image to see current implementation. Is it possible? Any kind of help would be greatly appreciated. enter image description here


Solution

  • You should create your own data set and use a UIPickerView to display the values. Trying to bend the date picker into doing something nonstandard like that could create a lot of side-effects and also break in future releases. Creating your own picker items is a much safer and cleaner way!