Skip to content

Commit

Permalink
Merge pull request #55 from gauravsingh1281/Issue-No.--#49
Browse files Browse the repository at this point in the history
Issue No. #49 [BUG FIXED] In the footer section, the copyright year should be dynamically generated instead of being statically hardcoded.
  • Loading branch information
samratghosh291 authored Oct 9, 2023
2 parents cdafd35 + e1fb21f commit 0a95f51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions copyrightYear.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let copyRightYear = document.getElementById("copyright-year");
let currentDate = new Date();
let currentYear = currentDate.getFullYear();
copyRightYear.innerText = currentYear;
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h4 id="title"></h4>

<!-- for footer -->
<footer class="footer2">
<p>Copyright © 2022 All Rights Reserved & Developed by Samrat Ghosh</p>
<p>Copyright © <span id="copyright-year"></span> Rights Reserved & Developed by Samrat Ghosh</p>
</footer>
<script>
const hamburger = document.getElementById("hamburger");
Expand All @@ -117,6 +117,9 @@ <h4 id="title"></h4>
});
</script>
<script src="script.js"></script>

<!-- Copyright Year --- -->
<script src="./copyrightYear.js"></script>
</body>

</html>
</html>

0 comments on commit 0a95f51

Please sign in to comment.