Topic: Datepicker min and max date?
TimTim pro asked 6 years ago
Mikołaj Smoleński staff answered 6 years ago
<div class="md-form"> <input placeholder="Selected date" type="text" id="date-picker-example" class="form-control datepicker"> <label for="date-picker-example">Try me...</label> </div> <button class="btn btn-primary change-date">Change max date</button>
$('.datepicker').pickadate(); var picker = $('.datepicker').pickadate('picker'); picker.set('max', new Date(2018,4,14)); $('.change-date').on('click', function() { picker.set('max', new Date(2018,4,25)); })Regards
Mikołaj Smoleński staff answered 6 years ago
<div class="md-form"> <input placeholder="Selected date" type="text" id="date-picker-example" class="form-control datepicker"> <label for="date-picker-example">Try me...</label> </div> <div class="md-form"> <input placeholder="Selected date" type="text" id="date-picker-example2" class="form-control datepicker2"> <label for="date-picker-example">Try me...</label> </div>Regards
TimTim pro commented 6 years ago
You misunderstood me! I do so. $ ('#date1'). pickadate ({ max: new Date (2018,5,14) }); This only works when the page loads. After assembling the page, this property does not change. How do I rebuild (change this property) without reloading the page? Thank you!FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No