jquery - DateTimePicker set secondary picker minDate to first select date -
i'm using datetimepicker
plugin here (http://trentrichardson.com/examples/timepicker/) , have 2 options, 1 being start date , second being end date. i'm trying set second (end date) first selected date can't select date prior first set date. i've tried can't working. code have end date is:
$('#enddate').datetimepicker({ timeformat: "hh:mm", stephour: 1, stepminute: 15, hourmin: 8, hourmax: 20, dateformat: "dd/mm/yy", mindate: date(moment($('#startdate').datepicker( 'getdate' )).format("yyyy, mm, dd")), });
which getting format shown in documentation, each time year 2021, instead of 2015 month , day correct!
i've used .moment
format date correctly have no idea why doesn't work correctly.
here revised code works fine me now
var startdatetextbox = $('#startdate'); var enddatetextbox = $('#enddate'); $.timepicker.datetimerange( startdatetextbox, enddatetextbox, { dateformat: "dd/mm/yy", timeformat: "hh:mm", mintime: '8:00 am', maxtime: '8:00 pm', stephour: 1, stepminute: 15, range: true, mindate: new date(moment().add(1, 'days').format("yyyy, mm, dd")), start: {}, // start picker options end: {} // end picker options } );
Comments
Post a Comment