Get value of ion-datetime


#1

Hello,

i have the code below, i want to pass the value from datetime to another page but date.value does not work.
Formulaire.html :


La Date de l’enquête
<ion-datetime displayFormat=“MMM DD YYYY” #date [(ngModel)]=“myDate”>

<ion-item>
  <ion-label floating>L'heure de l'enquête</ion-label>
  <ion-datetime displayFormat="h:mm A"  pickerFormat="h mm A"  #heure [(ngModel)]="myHour"></ion-datetime>
</ion-item>

</ion-list>

<button ion-button block color=“secondary” (click)=“goToOtherPage(nom , secteur , de , vers , date , heure , tranche )” >Commencer L’Enquête

Formulaire.ts

if ((nom.value != “”)&&(secteur.value != “”)&&(de.value != “”)&&(vers.value != “”)&&(tranche.value != “”))
{
this.mynumber= tranche.value;

  this.navCtrl.push( AccueilPage,{nom: nom.value,secteur: secteur.value, de:de.value,vers: vers.value,date:date.value,heure:heure.value, tranche: tranche.value});
}

accueil.ts

constructor(public navController: NavController , private file: File , public navParams: NavParams,private sqlite: SQLite) {

this.nom = navParams.get(‘nom’);
this.secteur = navParams.get(‘secteur’);
this.de = navParams.get(‘de’);
this.vers = navParams.get(‘vers’);
this.date = navParams.get(‘date’);
this.heure = navParams.get(‘heure’);
this.tranch = navParams.get(‘tranche’);
this.createDataBase();

}

but when i excute the code the value of date and hour do not display.
what should i do?