I am building a website for a shop and they want their opening hours to change based on the day a user views their site. How can I get a banner to display the relevant opening hours in relation to the day they are viewing the site?
Thanks
I am building a website for a shop and they want their opening hours to change based on the day a user views their site. How can I get a banner to display the relevant opening hours in relation to the day they are viewing the site?
Thanks
Could you elaborate on that? Like what does “they want their opening hours to change based on the day a user views their site” exactly mean. Maybe we can help you better with that info.
Hi Giri
So a banner that says the opening times for that specific day the user is viewing the site on.
For example Mondays is 9am to 3pm
Tuesdays is 10am to 5pm
Wednesdays Closed
So what ever day they view the site on it will give the opening times for that day.
Hi,
Yes, you can use JS Date.getDay() to find what day is today, and change the page contents accordingly. I you search the forum, you’ll find some code example.
See the Open for Business example…
Shows how to display if a business is currently “open for business”. Gets the visitor’s current date and time, checks if the business is currently open according to the configured business hours, and displays the current status. Also displays the business hours and highlights the current day’s hours.