-
Notifications
You must be signed in to change notification settings - Fork 57
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
min/max date $watch continuously #23
Comments
The standard approach in schema form has been to not watch changes in form definitions but instead let the user issue a Two solutions spring to mind (if the standard solution is not enough), one is to add an option to watch for changes of min/max, the other is to create an addon with two date fields explicitly for ranges. |
I'm not sure how the latter approach could work, one field handling 2 keys? |
I need to get an example going on how to do something like that soon, you aren't the first one to ask :) But basically you could swing something by letting it include the two fields, like a fieldset limited to two fields.
|
Hi @davidlgj @luciformed , I have find some work-around for this issue, Please have a look at my plnkr link http://plnkr.co/edit/Tkhgnh?p=preview I am an angular schema form noob. So, I would really appreciate your suggestion on my fix. Before going through the code, I would like to share you the logic what I followed.
Let me start with the template changes, I have added three attributes to the template "rangeStartDateField","rangeEndDateField","rangeSelector"
I have changed the config section of the bootstrap-datepicker.js
When we select the date, the date has been pushed to the view using ngModel.$parsers.push(function()); , Here I am getting the start date or end date and $emit the event
added the listeners to the event and updating the min and max date of the field as per my logic
This is my schema and form definition
|
any updates on this ? |
Common use case is to have two pickers to specify start and end dates, where end date cannot be before the start date. Doesn't it make sense to keep watching for min/max date changes?
The text was updated successfully, but these errors were encountered: