SuperMario32
SuperMario32

Reputation: 70

How to set default value of ion-datetime element?

I've set up my datetime picker like this:

<ion-item>
    <ion-datetime displayFormat="h:mm a" pickerFormat="h mm a" minuteValues="0,15,30,45" [(ngModel)]="whInput"></ion-datetime>
</ion-item>

Upvotes: 3

Views: 11290

Answers (1)

Lerb90
Lerb90

Reputation: 124

Set your var whInput ngModel in your constructor with a string value in the same format, if you use YY-MM set your var "16-11" When you use [(ngModel)]="myVar" => this is Two-way binding

see: enter link description here

Upvotes: 7

Related Questions