Skip to content

Commit

Permalink
Merge pull request #60 from sebj54/patch-1
Browse files Browse the repository at this point in the history
Cancel button now resolves the promise
  • Loading branch information
shiv19 authored Sep 26, 2019
2 parents 08edd23 + 850a605 commit 4c18076
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 4c18076

Please sign in to comment.