Remove the “Today” entry from UIDatePicker

When using a UIDatePicker in iOS SDK, there is always an entry “Today” at the current date.
That’s useful in most cases, but where I need it, it’s rather confusing.

Is there a way to:

  • Converting NSDate from a calendar to another
  • Swift Accessing year from UIDatePicker
  • UItableViewCell with UIDatePicker : month column gets covered
  • Modify UIDatePicker selection indicator tint color
  • localizing + customizing the date format of a UIDatePicker
  • Fitting a UIDatePicker into a UIActionSheet
  • a) disable the “today”-entry (use regular date instead), and have all entries look the same

    or even better

    b) disable the “today”-entry (use regular date instead), and color the next day in blue

    Further more, the application is for private use only, it’s not going to get distributed on the AppStore, which means I could use private APIs (I still would rather avoid them) and I don’t need it to be backwards compatible. iOS 4 is fine.

    2 Solutions Collect From Internet About “Remove the “Today” entry from UIDatePicker”

    I had a similar problem with the UIDatePicker not matching my requirements exactly (in my case I needed a datepicker without a year wheel). Having a look at the UIDatePicker reference, it doesn’t look like you can disable the today entry, so you might be forced to do what I did.

    I used a UIPickerView and re-implemented the date selection functionality I needed with that. There are a few things you will need to do to implement your custom date picker:

    • Implement a UIPickerViewDataSource to set up row titles, dimensions and row counts.
    • Implement a UIPickerViewDelegate to handle events from your custom picker.
    • Make sure you update your day wheel when the month wheel changes so you get appropriate days for each month. UIDatePicker does this pretty seamlessly. With limited time, I just reload the picker when the month changes so the day counts match up.

    I know an answer has been accepted but there actually IS a way to do this if you are displaying Date AND time. Its a hack but it works. Just seed the picker with a year other than today’s year, and the “Today” will disappear and be replaced with the canonical date.