jquery - Date range without an inline datepicker -


i'm trying in thread: date range picker on jquery ui datepicker

but dont want datepicker inline, , code works inline datepicker.

i need datepicker when selecting #date1 or #date2 inputs.

i must easy, i'm stuck here , solutions find google plugins or inline datepicker.

jquery ui's datepicker dropdown default, example found little out of date think.

https://jsfiddle.net/groberts/z4j227h6/

$( "#from" ).datepicker({   defaultdate: "+1w",   changemonth: true,   numberofmonths: 3,   onclose: function( selecteddate ) {     $( "#to" ).datepicker( "option", "mindate", selecteddate );   } }); $( "#to" ).datepicker({   defaultdate: "+1w",   changemonth: true,   numberofmonths: 3,   onclose: function( selecteddate ) {     $( "#from" ).datepicker( "option", "maxdate", selecteddate );   },   beforeshowday: function (date) {     var date1 = $.datepicker.parsedate($.datepicker._defaults.dateformat, $("#from").val());     var date2 = $.datepicker.parsedate($.datepicker._defaults.dateformat, $("#to").val());     return [true, date1 && ((date.gettime() == date1.gettime()) || (date2 && date >= date1 && date <= date2)) ? "dp-highlight" : ""];   }, }); 

the above code/fiddle shows few minor changes, can replicate functionality in dropdown.

hth.


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 -