jQuery Opening Times: Display Business Hours

If you are running a service website like restaurant or cafe, you will find this plugin come in handy. 

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="openingTimes.jquery.min.js"></script>
$('#business_time').openingTimes({
	openingTimes: {
		'Monday'    : ['09:00' , '18:00' ],
		'Tuesday'   : true,
		'Wednesday' : ['09:00' , '18:00' ],
		'Thursday'  : ['09:00' , '18:00' ],
		'Friday'    : ['09:00' , '18:30' ],
		'Saturday'  : ['09:00' , '12:00' ],
		'Sunday'    : ['09:00' , '12:00' ]
	},
	openString: "The shop is open",  // text to appear when shop is open
	closedString: "The shop is closed", // text to appear when shop is closed
	openClass: "openClass",  // class name added to element when shop is open
	closedClass: "closedClass"  // class name added to element when shop is closed
});
<div style="margin-top: 100px; text-align: center;">
	<h1 id="business_time"></h1>
</div>
  • ‘Monday’ : [’09:00′ , ’18:00′ ]: opening hours.
  • ‘Tuesday’ : true: if the shop is open the whole day, true can be used.
  • openString: “The shop is open”: text to show when shop is open
  • closedString: “The shop is closed”: text to show when shop is closed
  • Days of the week should be written in full, like Monday, Tuesday.
  • If you are closed for the whole day, don’t add the day to openingTimes parameters.

Leave a Comment

Your email address will not be published. Required fields are marked *

We care about your privacy and data security. Google serves cookies to analyse traffic and show ads on this site. By using this site you agree to these cookies being set. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close