Open jharting opened 8 years ago
Why not just make the date picker never change the model unless a date is picked? What is the reasoning behind having the date update when the user is browsing the calendar?
I do not know. It does not make sense to me either. However, given that this behavior is already in place I implemented the change with an additional param so that the change does not break existing users.
Also will be more "explicit" if in callbackOnSetDate will be passed view. Now in our projects we use this pull request with minor change:
scope.callbackOnSetDate(attrs.datePicker, scope.date, explicit && scope.view === 'date');
but I think will be more correctly if in callback function we will have more info about current state of datepicker.
This change makes it possible for the date-change callback to distinguish between explicit and implicit date changes. An explicit date change happens when a user explicitly select an option (e.g. a given day in the date view). An implicit date change happens e.g. in next()/prev() navigation.
Before this change there is no way to distinguish what exactly the user is doing. This change is useful when an app needs to perform an action when a user selects an option (e.g. a day).