ionic 2 date-time-local minute step 30 min

I have a datetime-local input field in my ionic 2 application, but I want to show only minutes with an interval of 30 minutes, i.e. only 0 or 30 (e.g. 9.00 or 9.30). I read about steps, but could not find for several minutes. Is there any way to achieve this?

+5
source share
1 answer

You can achieve this by setting the attribute for your input minuteValuesas follows:

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

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

EDIT:

. ion-datetime Ionic 1.x, Ionic 2.x. Ionic 1.x , ion-datetime-picker

+9

Source: https://habr.com/ru/post/1654071/


All Articles