Skip to content

Commit

Permalink
Set default date to today
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonglittle committed Dec 4, 2021
1 parent 95cc4c5 commit 3333aa3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions library-express/views/patrons.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<input type="text" name="lastName" required>
</p>
<p><label for="registerDate">Registered Date:</label><br>
<input type="date" name="registerDate">
<input type="date" name="registerDate" id="registerDate">
</p>
<p><label for="contactEmail">Email:</label><br>
<input type="email" name="contactEmail">
Expand Down Expand Up @@ -78,8 +78,14 @@
}</script>
<script type="text/javascript">
document.getElementById("redirectPatrons").onclick = function () {
{{!-- location.href = "/patrons"; --}}
window.location.href = "/patrons";
};
</script>
<script>
function todayDate() {
let today = new Date().toISOString().slice(0, 10);
$("#registerDate").val(today);
}
</script>
<script defer>todayDate();</script>
</div>

0 comments on commit 3333aa3

Please sign in to comment.