0

I have a counter embedded in a page and it works from the date and time specified as below;

$(document).ready(function (){
 $('#fade').county({endDateTime: new Date('**2016/10/05** 15:00:00'),reflection:false,animation:'fade',theme:'black'});
});

What I want to do is set the DATE to be today's DATE if before 15:00 on Monday, Tuesday, Wednesday, Thursday or Friday AND IF before 15:00 else I want the date to roll to the next day.

One other consideration is Bank Holidays. Would it be possible to have some kind of array of days that are considered to be weekend days as well?

Stuart
  • 690
  • 2
  • 9
  • 26
  • This question is a bit confusing. First of all, the format of the date in your code [will not parse well, or consistently across browsers/versions](http://stackoverflow.com/q/2587345/215552). Obviously whether it's possible to have an array depends on the code of this "county" plugin you're using, the code for which is not available in the question. – Heretic Monkey Oct 05 '16 at 18:30
  • Amended. Im trying to count down to Despatch cut off, which is 15:00 on Monday to Friday. I guess it would be something a little more than this https://gist.github.com/PerpetualBeta/3964527 – Stuart Oct 05 '16 at 18:33
  • Try use moment.js to manipulate dates. For example, [this fiddle](http://jsfiddle.net/p2z10611/) should works. Also try use [this plugin](https://gist.github.com/jrhames/5200024) to skip holidays. – Igor Lizunov Oct 05 '16 at 18:53
  • Thanks @IgorLizunov, this i just what I need (combined) but how do I introduce the two to generate that date I need for the above? – Stuart Oct 05 '16 at 19:19
  • What you're asking is fairly trivial using basic Date methods, there are plenty of good answers already. Post code, not requests for code. ;-) – RobG Oct 05 '16 at 22:45

0 Answers0