Skip to content

displaying the current day on the screen #1410

Answered by becky-gilbert
belginunal asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @belginunal, have you tried using the JavaScript Date.getDay function? This function returns a number, where 0 = Sunday, 1 = Monday, etc. You could use that along with an array of the day names to get the current day name, and then subtract from the current day index to get the indices/names of the last 4 days. Feel free to post your code if you need further guidance.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@belginunal
Comment options

Answer selected by belginunal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants