title: Daily Timer to Exempt Days and Allow for DST in UK - FlipClock.js
body: <p>I am just after a bit of advice really relating to the Flipclock.js plugin.</p>
  
  <p>I have written the following code with a fair amount of assistance to make the clock countdown every day, which as far as I can tell is working well as I have struggled like mad to find solid documentation online for daily timers doing what I desire.</p>
  
  <p>This is for a daily timer to showcase expiry time for a free delivery threshold of 1500 hours, however at weekends this would not be the case.   Is it possible to use a conditional to check to see if the current day is Saturday or Sunday, and if so, increase the hours accordingly to display total hours/minutes until 1500 on the Monday?</p>
  
  <p>My last concern is that I am grabbing information based on UST.  The UK is currently 1 hour offset, but it won't always be.  Is the only feasible solution to use an if only statement and offset the hour based on the dates of daylight saving time - or is there a smoother solution?</p>
  
  <p>Thanks for your help</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>      var clock;
    
    // Check if it is a weekend or not
        var d = new Date();
        var n = d.getDay();
        if( n == 6 )
         var deadlineHour = 15, offset = 2;
        else if( n == 0)
          var deadlineHour = 15, offset = 1;
        else
          var deadlineHour = 15, offset = 0;
  
      $(document).ready(function() {
  
          // Grab the current date
          var currentDate = new Date();
  
          if(currentDate.getHours() &gt;= deadlineHour) {
              offset = 1;
          }
        
          var opts = {
          clockFace: 'HourlyCounter',
          countdown: true,
          callbacks: {
              stop: function() {
                  clock.setTime(24 * 60 * 60);
                  clock.start();
              }
          }
      };
      opts.classes = {
          active: 'flip-clock-active',
          before: 'flip-clock-before',
          divider: 'flip-clock-divider',
          dot: 'flip-clock-dot',
          label: 'flip-clock-label',
          flip: 'flip',
          play: 'play',
          wrapper: 'flip-clock-small-wrapper',
      };  
  
          var futureDate = new Date(
              currentDate.getFullYear(), 
              currentDate.getMonth(), 
              currentDate.getDate() + offset, 
              deadlineHour
          );
  
          // Calculate the difference in seconds between the future and current date
          var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000;
  
          // Instantiate a coutdown FlipClock
          clock = $('.clock').FlipClock(diff, opts);
  
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script type='text/javascript' src='//code.jquery.com/jquery-1.10.1.js'&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src="http://flipclockjs.com/_themes/flipclockjs/js/flipclock/flipclock.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="http://flipclockjs.com/_themes/flipclockjs/css/flipclock.css"&gt;
      
  &lt;br/&gt;&lt;div class="clock"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>