How to set default value of ion-datetime element?

10,876

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

Share:
10,876
SuperMario32
Author by

SuperMario32

Updated on June 08, 2022

Comments

  • SuperMario32
    SuperMario32 almost 2 years

    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>