ALX-SE-Algorithmia / ALX-SE-Algorithmia.github.io

Algorithmia SE 🌏's Static Website (GitHub)
https://alx-se-algorithmia.github.io/
MIT License
5 stars 29 forks source link

Year updater with js #94

Open SamuelWorld20 opened 9 months ago

SamuelWorld20 commented 9 months ago

Is your feature request related to a problem? Please describe.

I noticed in the footer the year 2023 is still there, then I checked the code and found out the year was just inputted there manually

Describe the solution you'd like

So I discovered we can use a JavaScript code to make it automatic (i.e input the year it's self)

Describe alternatives you've considered

Here is how I suggest the code to be

<div class="copyright"> &copy; <script>document.write(new Date().getFullYear());</script> Algorithmia SE 🌍. All Rights Reserved </div>

Or it can be written in the js file separately this way

var currentYearElement = document.getElementById('currentYear'); if (currentYearElement) { currentYearElement.innerText = new Date().getFullYear(); }

Then the html file should have this

<div class="copyright"> &copy; <span id="currentYear"></span> Algorithmia SE 🌍. All Rights Reserved </div>

Additional context

Screenshot (253) Screenshot (252)

I hope you consider my request

dohoudaniel commented 9 months ago

Hi there. Thank you for your attention to detail. Please, create a PR, and propose your solution, tagging this issue you created, and @ALX-SE-Algorithmia/code-reviewing-team. Thank you, Samuel 🌟