JSFiddle - React, Tailwind, and code Playground

HTML

In years only:
<input id="contract" type="text" />
<input id="start" type="text" />
<input id="end" type="text" />

JavaScript

$('#end').datepicker();
$('#start').datepicker({
    onSelect: function (date, args) {
        var addYears = parseInt($('#contract').val());
        var t = date.split('/');
        var fin = new Date(t[2], --t[0], t[1]);
        $('#end').datepicker("setDate", fin);
    }
});