How to set the default date of ion-datetime is current month 1st date Ionic-v3 .
Thanks for reading!

I thing that for this is the best way to use moment.js. With momentjs you can check actual month and then set [(ngModel)] value for ion-datetime.

Hope that this will help you :wink:

Hi, @nadapana

Try this:

Add this code in templet file

  <ion-datetime displayFormat="DD.MM.YY" [(ngModel)]="defalutDate"></ion-datetime>

Add this code in component file

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

  selector: 'page-home',
  templateUrl: 'home.html'
export class HomePage {


      constructor(public navCtrl: NavController){
         let currentDate  = new Date();
         this.defalutDate = currentDate.getFullYear()+'-'+("0" + (currentDate.getMonth() + 1)).slice(-2)+'-'+'01';     

Thank you

Thanks. for your replay.

i am new to ionic . you saved my time

that worked for me.

if your issue was resolved, Please mark as a solution.