Show only the enabled dates on bootstrap datepicker -
i have 2 twitter bootstrap datepickers (from , to). have disabled every date on 'from' datepicker except today , set startdate on 'to' datepicker '+1m'. have 2 questions here:
- the 'from' datepicker uses update method choosing today default date, set startdate , enddate '0', default date no longer appearing in input field. after select 'today' in calendar, appearing in input field. how solve problem?
- i want 'to' datepicker have startdate of '+1m'. now, when open it, see current month dates in month disabled. when go next month, allowed dates visible. how make sure month see 1 selectable dates?
thanks in advance :)
you can add min , max input type=date:
<input name="date" type="date" min="2016-05-17" max="2017-05-17">
to control start , end dates dependant on current date use:
var today = new date().toisostring().split('t')[0]; document.getelementsbyname("date")[0].setattribute('min', today); var month = new date(new date(today ).setmonth(today .getmonth()+1)); document.getelementsbyname("date")[0].setattribute('max', month );
Comments
Post a Comment