Forum Archive

Setting minute increment size for datepicker

rgorinstein

Hello,

I’d like to be able to alter the datepicker so the minute increments are only shown as 5- or 15-minute increments rather than 1-minute increments as it defaults. In Calendar.app, for example, the iOS time picker defaults to 5-minute increments. Is there any way to achieve this?

Thanks in advance!

JonB

I haven't tried it but

minuteInterval

Attribute of the picker objc_instance should do it.

JonB
d=ui.DatePicker()
d.mode=ui.DATE_PICKER_MODE_DATE_AND_TIME
d.objc_instance.minuteInterval=5
d.bg_color='white'
d.present()