Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Time tracking dashboard solution || HTML, CSS, JS

Luis Colina 1,043

@Comet466

Desktop design screenshot for the Time tracking dashboard coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

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-pro

Posted

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 helpful

0

Luis Colina 1,043

@Comet466

Posted

@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 GitHub
Discord logo

Join 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