Fix Latest Events Section #36
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Mr. Elzero, I hope you are well.
I was watching the Pull Request lesson in the Git & GitHub Course, so I wanted to apply what I learned.
So I searched for any bug or fix to maintain it and create a pull request to you.
Then, I noticed that there was a bug in the "Latest Events" section in this project.
What is the problem?
According to the JS code in the main.js file from line 9 to 34, it runs the code inside the setInterval first, Then it checks whether the date has reached the current date or not.
If the date hasn't reached the current date, it works.
But if the date has reached the current date, it will run the code before this check first, then it finds that the date has reached the current date so it runs clearInterval. So if the current date is after the date in the JS code It will count negatively and display wrong values in the page.
What did I do?
First, I make the values in the HTML file "00".
Second, I made some changes in the JS file:
Finally, I noticed that when the value of numbers is big, they are not displayed correctly. So I made a few changes in the CSS styles.
I hope these changes are useful for this project. And I want to thank you for all the courses and efforts you make for us.
Thanks for your time.