Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to remove hours and add seconds to a UIDatePicker?

In my application I want people to be able to select a minute and second rather than an hour and a minute.

Is there a way to remove the hours and add seconds as an option for a UIDatePicker?

enter image description here

like image 448
Dan Beaulieu Avatar asked Apr 13 '15 17:04

Dan Beaulieu


2 Answers

I did a quick review of the documentation and I don't think you can do just minutes and seconds. After all, this would not really be a Date picker anymore, just a minute/second picker.

Not knowing your app at all, I think you should be able to create your own UIPickerView instance or subclass and configure it with Minutes and Seconds easily enough.

like image 183
Dan Loughney Avatar answered Sep 28 '22 14:09

Dan Loughney


I realize this is a bit late, but in case anyone else find this I made LETimeIntervalPicker a while ago. It's like a UIDatePicker but with hours, minutes and seconds. https://github.com/ludvigeriksson/LETimeIntervalPicker

like image 37
ludvigeriksson Avatar answered Sep 28 '22 14:09

ludvigeriksson