Missak Boyajian
Missak Boyajian

Reputation: 2245

ionic 2 datetime-local minute step 30 min

I have a datetime-local input box in my ionic 2 app but I want to show the minutes in 30 min interval only, that is only 0 or 30 (like 9.00 or 9.30). I read about steps but could not find for minutes. Is there a way to achieve it ?

Upvotes: 6

Views: 5852

Answers (1)

thepio
thepio

Reputation: 6263

You should be able to achieve this with setting a attribute minuteValues to your input like this:

<ion-datetime displayFormat="HH:mm" [(ngModel)]="myDate" minuteValues="0,30">

The minuteValues can be an array of numbers or a string of comma separated numbers.

EDIT:

Based on comment. ion-datetime directive is not available in Ionic 1.x but can be used in Ionic 2.x. For Ionic 1.x you can use a plugin like ion-datetime-picker

Upvotes: 13

Related Questions