Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229735

Ionic2 date popup with current date

$
0
0

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();
    }

Viewing all articles
Browse latest Browse all 229735

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>