Problem: I would like to set a minimum end date for my range datepicker based on the value selected for the start date. Users should not be able to select an end date before the start date.
Solution: Add some JavaScript that will set datepicker options using the 'onClose' datepicker option:
jQuery(document).ready(function () { var toolset_date_range_handler = function(date, datepicker) { jQuery('.js-wpv-date-front-end-event-end-date-and-time').datepicker('option', 'minDate', date); }; jQuery('.js-wpv-date-front-end-event-start-date-and-time').datepicker('option', 'onClose', toolset_date_range_handler); });
Relevant Documentation: http://api.jqueryui.com/datepicker/#option-onClose
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 réponses, has 2 voix.
Last updated by Shreyas Khatri Il y a 6 années et 9 mois.
Assisted by: Christian Cox.