nativescript-datetimepicker
nativescript-datetimepicker copied to clipboard
no events
is there any event which triggers on when you click on ok button on datePicker
Hey @kapil9-10,
Did you check the Getting/Setting Date and Time section on Features?
You can listen to the dateChange event on DatePickerField.
Here is an example of using it with vue binding:
<DatePickerField @dateChange="onDateTimeChange1" :date="dateTime1"></DatePickerField>
Where dateTime1 is your date, for example:
data() { return { dateTime1: new Date(), } },
Then in your methods:
methods: { onDateTimeChange1: function(args) { this.dateTime1 = args.value; },
So it will get the date on args.value when you click the 'OK' button. If you click 'Cancel', it will no get the value and it will keep the old one.
Hope it helps.
thanks for help,, one more query how will I know when he just scroll or clicked ok
Hi @kapil9-10,
good to know it helped you.
I don't know if there's an event to capture the scroll, but the click is get on the dateChange event.
So, as I explained in the last post, when you click on 'OK', it will get the value that you have set. Otherwise, if you click 'Cancel', it will get the old value.
So you can get the 'OK' click on dateChange event =)
Hope it helps!