tempusdominus/bootstrap-4

time buttons doesn't fire input event

Closed this issue · 4 comments

#As example.
If you enter data into the text field, the event will be fired.
If you press buttons in the datetimepicker, events will not be fired.

https://jsfiddle.net/pbLxedap/2/

I believe the test at ~ line 556 of https://github.com/tempusdominus/bootstrap-4/blob/master/build/js/tempusdominus-bootstrap-4.js

would be more correct - and readable - with parenthesis :

for e.g. e = {type: "datetimepicker.show"}

e.type === DateTimePicker.Event.CHANGE && e.date && e.date.isSame(e.oldDate) || !e.date && !e.oldDate
-> true -> then the function returns and does not fire the event 👎
e.type === DateTimePicker.Event.CHANGE && ((e.date && e.date.isSame(e.oldDate)) || (!e.date && !e.oldDate))
-> false 👍

It still does not work.
https://jsfiddle.net/6h1ak85w

@kamilj your fiddle has console errors. please let me know if it still doesn't work with the latest BS and picker