trentrichardson / jQuery-Timepicker-Addon

Adds a timepicker to jQueryUI Datepicker
http://trentrichardson.com/examples/timepicker/
MIT License
2.66k stars 1.05k forks source link

Future date disabled by default #961

Closed risnaa closed 4 years ago

risnaa commented 4 years ago

I am populating input field with existing db value. Now its working as MaxDate.

I am using below code : HTML <input type="text" id="restrict_from_date" name="restrict_from_date" value="<?= isset($clubRestrictionDetail->restrict_from_date) ? date("d M Y",strtotime($clubRestrictionDetail->restrict_from_date)) : '' ?>" class="form-control" readonly>

<input type="text" id="restrict_to_date" name="restrict_to_date" value="<?= isset($clubRestrictionDetail->restrict_to_date) ? date("d M Y",strtotime($clubRestrictionDetail->restrict_to_date)) : '' ?>" class="form-control" readonly>

JS CODE $(document).ready(function () { var dateToday = new Date(); var restrict_from_date = $('#restrict_from_date'); var restrict_to_date = $('#restrict_to_date'); var start_date = new Date(2019,09,17); $.timepicker.dateRange( restrict_from_date, restrict_to_date, { minInterval: (24 1000 60 * 60), // 1hr dateFormat: 'dd M yy', start: {}, // start picker options end: {} // end picker options
} ); });

Above code screen shot attached screencapture

Thanks in advance.

Regards, Avinash S