Weź przekaż na Owsiaka albo coś.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
SECTION {
display:-ms-flex;
display:-webkit-box-flex;
display:-webkit-flex;
display:flex;
}
FIELDSET {
-ms-flex:0 1 33.33%;
-webkit-box-flex:0 1 33.33%;
-webkit-flex:0 1 33.33%;
flex:0 1 33.33%;
}
INPUT {
width:100%;
}
</style>
</head>
<body>
<section>
<fieldset>
<legend>Wybierz datę początkową</legend>
<input id="data_start" type="date">
</fieldset>
<fieldset>
<legend>Wpisz liczbę dni</legend>
<input id="dni_ile" type="number" min="0" max="365" step="1" value="0">
</fieldset>
<fieldset>
<legend>Wynik: Data końcowa</legend>
<input id="data_stop">
</fieldset>
</section>
<script>
function przelicz() {
var tab_dni = ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"];
var dni_ile = document.querySelector("#dni_ile").value;
var data_s_start = document.querySelector("#data_start").value;
var data_o_start = new Date(data_s_start);
var data_u_start = data_o_start.getTime();
var data_u_stop = data_u_start + (dni_ile * 24 * 3600 * 1000);
var data_o_stop = new Date(data_u_stop);
var data_s_stop = data_o_stop.getFullYear() + "-" + ("0"+(data_o_stop.getMonth()+1)).slice(-2) + "-" + ("0" + data_o_stop.getDate()).slice(-2) + " " + tab_dni[data_o_stop.getDay()];
if (isNaN(data_u_start)) data_s_stop = "niepoprawna data";
if (((dni_ile*1)==0) && (dni_ile!=="0")) data_s_stop = "niepoprawna liczba dni";
document.querySelector("#data_stop").value = data_s_stop;
}
document.querySelector("#data_start").addEventListener("input", przelicz);
document.querySelector("#dni_ile").addEventListener("input", przelicz);
</script>
</body>
</html>