Skip to content

Commit

Permalink
style: Add dynamic year update script to footer component
Browse files Browse the repository at this point in the history
  • Loading branch information
wajeht committed Aug 14, 2024
1 parent 47e81f2 commit adad23c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/db/migrations/20240807213915_create_tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export async function up(knex: Knex): Promise<void> {
table.increments('id').primary();
table.integer('user_id').unsigned().references('id').inTable('users').onDelete('CASCADE');
table.string('name').notNullable();
table.string('description').nullable();
table.boolean('is_active').defaultTo(true);
table.timestamps(true, true);

Expand Down
8 changes: 7 additions & 1 deletion src/views/components/footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<script>
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('year').innerText = new Date().getFullYear();
})
</script>

<footer style="flex: 0; padding: 20px; text-align: center;">
<p>
Copyright © 2024. Made with ❤️ by
Copyright © <span id="year"></span>. Made with ❤️ by
<a href="https://github.com/wajeht" title="https://github.com/wajeht" target="_blank">wajeht</a> |
<a href="https://github.com/wajeht/notify" title="https://github.com/wajeht/notify" target="_blank">github</a>
</p>
Expand Down

0 comments on commit adad23c

Please sign in to comment.