Skip to content

Commit

Permalink
Set book purchase date to default to today
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonglittle committed Dec 5, 2021
1 parent b8a8f9b commit bac1961
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions library-express/views/books.handlebars
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
crossorigin="anonymous"></script>

<h1>Library Inventory Management</h1>
<form id="addBook" action="/books" method="post">
<h2>Add Book</h2>
Expand Down Expand Up @@ -50,4 +53,12 @@
{{/each}}
</tbody>
</table>
</script>
<script>
function todayDate() {
let today = new Date().toISOString().slice(0, 10);
$("#purchaseDate").val(today);
}
</script>
<script defer>todayDate();</script>
</div>

0 comments on commit bac1961

Please sign in to comment.