Time tracking dashboard solution || HTML, CSS, JS
Design comparison
Solution retrospective
in this challenge i had a function that gets the content from the JSON file but i was unable to add the content to a global variable, i had to call the function and read the content in his local scope, can somebody tell me if it is even posible to add the content of a external JSON to a variable, thanks and happy coding
Community feedback
- @rajat1997-proPosted about 3 years ago
hey, nice code just one thing that the time period should change dynamically, for daily it should be yesterday, for weekly last week, and for monthly last month. You can achieve this functionally by comparing the button text which is clicked with strings daily, weekly and monthly. ex: $(button).on("click",function (e){ buttonText = e.target.textContent.toLower(); if (buttonText === "daily"){ $(.daily-button).text("Yesterday"); } else if(buttonText === "weekly"){ $(.weekly-button).text("Last Week"); } else if(buttonText=== "monthly"){ $(.monthly-button).text("Last Month"); } })
Marked as helpful0@Comet466Posted about 3 years ago@rajat1997-pro thank you Rajat i didnt used jquery in this project but i do realized that i missed the detail of the previous time, the only thing that i had to add was this line of code to the forEach that runs the containers.
prev[index].textContent = "Yesterday- "+ day.daily.previous+"hrs"
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord