JSFiddle - React, Tailwind, and code Playground

by DinoMyte

HTML

Start Date : <input type="text" id="start" value="1/1/2010">
<br>
Length In Months : <input type="text" id="month" value="3">
<br>
End Date : <input type="text" id="end">

JavaScript

$.fn.addMonths = function()
{ 
  var st = new Date($("#start").val());
  var month = $("#month").val();
  $("#end").val((new Date(st.setMonth(st.getMonth() + month)).getMonth() + 1) + '/' + st.getDate() + '/' +  st.getFullYear());  
};

$("#start,#month").change(function()
{ 
 $("#end").addMonths(month);
}).change();