Skip to content

Commit

Permalink
Cancel button now resolves the promise
Browse files Browse the repository at this point in the history
Promise is resolved without a result
  • Loading branch information
sebj54 authored Sep 24, 2019
1 parent 08edd23 commit 850a605
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/modal-datetimepicker.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export class ModalDatetimepicker {
datePickerInstance.setMinDate(options.minDate.getTime());
}

this.datePicker.setOnCancelListener(new android.content.DialogInterface.OnCancelListener({
onCancel: () => {
resolve();
}
}));

this.datePicker.show();
} catch (err) {
reject(err);
Expand Down Expand Up @@ -97,6 +103,12 @@ export class ModalDatetimepicker {
options.is24HourView
);

this.timePicker.setOnCancelListener(new android.content.DialogInterface.OnCancelListener({
onCancel: () => {
resolve();
}
}));

this.timePicker.show();

let toastMsg = "";
Expand Down

0 comments on commit 850a605

Please sign in to comment.