Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date-change callback - distinguish explicit selection #250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jharting
Copy link
Contributor

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).

…alled for an explicit date selection or something like next()/prev()
@AdamGerthel
Copy link

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?

@jharting
Copy link
Contributor Author

jharting commented Mar 1, 2016

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.

@dumitru
Copy link

dumitru commented Oct 3, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants