JSFiddle - React, Tailwind, and code Playground
HTML
<input id="from" type="text" class="datepicker" />
<input id="to" type="text" class="datepicker" />
<input id="submit" value="Send" type="submit" />
JavaScript
// 2013-10-21T00:00:00
Number.prototype.padLeft = function(base,chr){
var len = (String(base || 10).length - String(this).length)+1;
return len > 0 ? new Array(len).join(chr || '0')+this : this;
}
function parseDate(d) {
return [d.getDate().padLeft(), (d.getMonth()+1).padLeft(), d.getFullYear()].join('/')+'T'+
[d.getHours().padLeft(), d.getMinutes().padLeft(), d.getSeconds().padLeft()].join(':');
}
$(function () {
$(".datepicker").datepicker();
$("#submit").click(function () {
var from = $('#from').datepicker('getDate');
var to = $('#to').datepicker('getDate');
console.log( "xxxx/?from=" + parseDate(from) + "&to=" + parseDate(to) );
$.getJSON("xxxx/?from=" + parseDate(from) + "&to=" + parseDate(to));
});
});