date
<!DOCTYPE html>
<html>
<head>
<title>Js問題 CalcDate</title>
</head>
<body>
<input type="text" id="dateInput" placeholder="yyyy/MM/dd">
<br>
<button onclick="CalcDate()">計算</button>
<br>
<input type="text" id="result">
<script>
function CalcDate() {
//入力された日付の処理
let inputStr = document.getElementById("dateInput").value;
let inputDate = new Date(inputStr);
let num1 = inputDate.getFullYear() + inputDate.getMonth() + 1 + inputDate.getDate();
console.log(num1);
//本日日付の処理
let today = new Date();
let num2 = today.getFullYear() + today.getMonth() + 1 + today.getDate();
console.log(num2);
// 結果を表示
document.getElementById("result").value = num1 - num2;
}
</script>
</body>
</html>