-
Notifications
You must be signed in to change notification settings - Fork 328
Change month when dateMinLimit is set #214
Conversation
|
Hi @lucas3003 actually not bad! Just check this out and this This is how watchers are deregistered, if you can please adapt the code both for If you want you can add watchers for all these attributes: min-date, max-date, date-format These watchers must be implemented, here is the related issue in case https://github.com/720kb/angular-datepicker/issues/218 so that you can close the issue too :) Thank you for your time 👍 |
|
Hi, @45kb ! Thanks for the feedback! I adapted the code and now the watcher is being deregistered. If you think it is good, I can implement to the other watchers you mentioned. |
|
@lucas3003 IT IS GOOD! :) Yes, if you can do it, feel free to add the other missing watchers (the one i listed), so you also close an issue with this PR ;) Let me know. |
|
@45kb Glad you appreciated the work! I implemented the 2 left watchers. I am just not sure if this is the best way to implement date-format watcher. Thanks! |
|
@lucas3003 looks ok, check my comments. |
45kb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing { } curlyes on if statments :)
src/js/angular-datepicker.js
Outdated
| } | ||
| }) | ||
| , unregisterDateMaxLimitWatcher = $scope.$watch('dateMaxLimit', function dateMaxLimitWatcher(newValue){ | ||
| if(newValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing { } curlyes
src/js/angular-datepicker.js
Outdated
| resetToMaxDate(); | ||
| }) | ||
| , unregisterDateFormatWatcher = $scope.$watch('dateFormat', function dateFormatWatcher(newValue){ | ||
| if(newValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing { } curlyes
|
@45kb I added the curlyes. I have tested in a small application I am working on. |
|
@lucas3003 done :) thank you I will make a new version in a while so you can easily update it via npm or bower. |
|
shipped in 2.1.8 https://github.com/720kb/angular-datepicker/releases/tag/2.1.8 thank you! |
In one of my applications, I have two linked datepickers, one called "start" and other called "finish." When I choose the start date, I want the "finish" datepicker to move to the month I chose on "start" datepicker. I am now able to do that with this little change and setting date-min-limit.
I do not know if this is the best way to solve this problem; however, it worked for me so I wanted to contribute.
Please let me know if I was not clear enough or you need more details.