asked on May 12, 2017
•
Show version history
Hi All
I have JavaScript code to restrict the date input in a date picker (.DateTo) to be only greater than another date picker (.DateFrom) selection for the format M/d/yyyy, this code works but it does not work for the format yyyy-mm-dd.
How can i tweak my code to achieve this ?
$(document).ready(function(){
function updateMinimumEndDate ()
{
var minimum = $('.DateFrom input').val();
var minSplit = [];
minSplit = minimum.split("/");
var newMin = (minSplit[2]+"-"+minSplit[0]+"-"+minSplit[1]);
$('.DateTo input').attr('min',newMin);
}
$('.DateFrom input').change(updateMinimumEndDate);
});
Any suggestions please ?
0
0