jQuery Opening Times: Display Business Hours

If you are running a service website like a restaurant or cafe, you will find this plugin comes 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
});
$('#open_or_closed').openingTimes({
    openingTimes: {
        'Monday'    : ['08:00' , '17:00' ],
        'Friday'   : ['08:00' , '17:00' ]
    }
});
<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 the shop is open
  • closedString: “The shop is closed”: text to show when the shop is closed
  • Days of the week should be written in full, like Monday, and 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 *


Scroll to Top

By continuing to use the site, you agree to the use of cookies. 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