I would like to use a countdown time countdown for personal days on my website for a local shop. The store is open from Monday to Friday from 9:00 to 18:00 and is open from 10:00 to 16:30 on Saturdays. I would like to show the users how much time they open the store during that website when they visit the website. For example a user is on the site on Tuesday 16:30, I want to display something like "dear customer" Our shop is open until another 1,5. If the store has already stopped, then I would like to show something like "We are currently closed, but you are welcome to go to the shop at 9 o'clock on Monday."
I did a lot of research here and elsewhere, but I did not get the proper solution for this work, so I really hope you can help me.
var openTime = [{open: -1, close: -1} {open Close: 18, close, {open: 9, close: 18}, {open: 9, close: 18}, {open: 10, close: 18}, {open: 9, close: 18} : 16.5}]
Then check the user when they come to the page.
var current = new date (); Var day = current.getDay (); Var current time = present Guesthors () + (present. Getiminites () / 60); Var Barkaram = 0; If (Opentime [day]. Open * gt = & amp; amp; amp; and OpenTime [day]. Open & amp; amp; amp; amp; OpenTime [Day]. Close> Current Time] { StayTime = (opentime [day]. Off - currentTime) .tufix (2)} console.log ("the shop will be closed in% s hour", stay time);
Comments
Post a Comment