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:

  1. 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?
  2. 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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -