I am using ion-datetime with pickerOptions.
I want to display original datetime value when the user select ‘Cancel’, but I cannot.
Can anybody please help me?
<ion-datetime [value]="value" [pickerOptions]="customPickerOptions"></ion-datetime>
value = "2019-09-19 10:00:00";
customPickerOptions = {
buttons: [
{
text: 'OK',
handler: ev => {
console.log(ev);
}
},
{
text: 'Cancel',
role: 'cancel',
handler: () => {
// I want to set initial datetime here
// when the picker is cancelled.
console.log('cancelled');
this.value = "2019-09-19 10:00:00";
}
}
]
};