Reputation: 935
I want create a ion-date time with three button : cancel , done and clear. so I custom in here:
Add button clear data ion-datetime
I want if date is chose I can click Clear in modal date picker to remove value same when click button Clear Data. How I can do it? Thank every one
Upvotes: 3
Views: 3725
Reputation: 179
I’m using :
I’ve added a custom button to a ionic-datetime
<ion-datetime
formControlName="myDateCustom"
[pickerOptions]="customPickerOption">
</ion-datetime>
and ts.
customPickerOption = {
buttons: [{
text: 'Clear',
handler: () => this.myForm.controls['myDateCustom'].setValue(null)
}]
Upvotes: 2