Date popup with current date


#1

Is there any way to display showing current date in ionic2 of datepicker ??
eg…today date is 6/21/2017.
So, When datepicker pops up,initial value will be today date like

If there any input properties of ion date or any ways,pls suggest me. Thanks so much in advance !!!


#2

If you are using ngModel to save date value, set it to current date at component constructor.

 <ion-datetime [(ngModel)]="dateVariable"></ion-datetime>
@Component({
    selector: 'page-example',
    templateUrl: 'example.html'
})
export class ExamplePage {
    dateVariable: string;

    constructor(){
        this.dateVariable : new Date().toISOString();
    }

#3

Thanks @Ramonsan…It shows current date not only before pick but also in datepicker. But I want current date is only showing in datepickernot in before picking . Is there any way ? Thanks in advance.