JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" class="input-small " id="v_map_1" date-format="dd-mm-yyyy">
<input type="text" class="input-small " id="v_map_2" date-format="dd-mm-yyyy">
JavaScript
$(document).ready(function(){
$(function() {
$( "#v_map_1" ).datepicker({
defaultDate: "-d",
changeMonth: true,
numberOfMonths: 1,
dateFormat:"yy-mm-dd",
maxDate:"-d",
onClose: function( selectedDate ) {
var d=selectedDate.split("-");
var da=d[2];
var mo=d[1];
var yr=parseInt(d[0])+1;
var nd=yr+"-"+mo+"-"+da;
$( "#v_map_2" ).datepicker( "setDate", nd );
}
});
$( "#v_map_2" ).datepicker({
changeMonth: true,
dateFormat:"yy-mm-dd",
});
});
});