Hi all,
i have a problem with an ion-datetime component, i have this code in the html:
<ion-datetime displayFormat=“DD/MM/YYYY HH:mm” [pickerOptions]=“customPickerOptionsFecCitaIni” [(ngModel)]=“Parte.CitaFechaHoraIni”>
The field citafechahoraini is a string value, with this format: 08/04/2020 23:45
The customPickerOptions is this:
this.customPickerOptionsFecCitaIni = {
buttons: [{
text: ‘Limpiar’,
handler: () => {
this.Parte.CitaFechaHoraIni = undefined
}
},{
text: ‘Cancelar’,
role:‘cancel’
}, {
text: ‘Guardar’,
handler: (data) => {
this.Parte.CitaFechaHoraIni = data.day.text+"/"+data.month.text+"/"+data.year.text+" “+data.hour.text+”:"+data.minute.text;
}
}]
};
The value of Parte.CitaFechaHoraIni is 08/04/2020. 8 of april… IT IS the correct value, but…
If i open the page, in the datepicker i see this:
and when i choose the date i see the month 8 when it will be 4. Why it occurs??
Any help? THANKS!