javascript - jQuery countdown timer for events -


This is the first time that I will ask a question here, so I hope I will correct it.

I am creating a countdown for the early hours of our canteen. This canteen opens from 7.45 to 12.45 and thereafter there is a break at 13.30 hrs.

I have made countdown 7.45, but I would like the countdown to 13.30 when they close for a break at 12.45. On Friday they close at 12.45, so there is no break on that day.

Here's my code:

Index.php

   

ext.js

  $ (document) .ready (function () {$ ('# countdown'). Countdown ({Date: 28 October 2014 7:45:00 '}, function () {$ (' # countdown '). Text (' canteen is open: D '}})});  

countdown.jquery.js

  (function ($) {$ .fn.countdown = function (option, callback) {var settings = {' (Option) ($) extension (settings, options);} this_cel = $ (this); function count_exec () {eventDate = Date.parse (settings ['date']) / 1000; current date = math.flur ($ Now () / 1000) if (eventdate and lieutenant = current date) {callback.call (this); clear interval (interval);} sec = event date - current date, day = monastery seconds (/ sec 60 * 60 * 24)) seconds - = days * 60 * 60 * 24; Hours = math.flur (second / (60 * 60)) seconds - = hours * 60 * 60; Minute = math.flur (seconds / 60) seconds = minutes * 60; Day = (string (day). Length and lt; = 1)? '0' day: day; Hours = (string (hour). Length and lt; = 1)? '0' hours: hours; Min = (string (min) height = lt; = 1)? '0' + minutes: minutes; Secs = (string (seconds) length  

You have 3 dates, 7:45, 12:45 and 13:30 May be. If current date is & lt; 7:45, then show the countdown to open. If the current date is> 12:45 show count is at 13:30.


Comments