help me please! I just can't do this: I have two calendars. in the first, the minimum date is today. then the user chooses any day. and in the second you need to set the minimum date to the one that the user selected in the first calendar. I will be grateful if you tell me how to do it
var now = new Date(); var today = now.getFullYear() + '-' + parseInt(now.getMonth() + 1) + '-' + now.getDate(); $(function() { $('.thisday').prop('min', function() { return new Date().toJSON().split('T')[0]; }); }); $(function() { $('.backDay').prop('min', function() { return //здесь должно быть то,чего я не знаю; }); });
<input class="thisday" placeholder="date" type="date" id="min" max="2016-12-31"> <input class="backDay" placeholder="date" type="hidden" id="min" max="2016-12-31">