Re: Convert to VBScript to JavaScript ?



JRS: In article <435391c8$0$28207$5a62ac22@per-qv1-newsreader-
01.iinet.net.au>, dated Mon, 17 Oct 2005 21:58:19, seen in
news:comp.lang.javascript, Zif <Zifud@xxxxxxxxxxx> posted :
>
> var now = new Date(); // start from today
>
>// Use following to set the date for testing
>// var now = new Date(2005, 9, 21);
>
> // Set the date to the next Friday
> now.setDate(now.getDate() - ((now.getDay()+2)%7));

ISTM add 7 for next Friday.
I think the OP's code allowed today as a starting point, in which case
add 6 and adjust the getDay()+ number by 1.

The OP allowed his posting agent to wrap his code :-(.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
.



Relevant Pages

  • Re: explain what this means
    ... function getObj{var T ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ... Prev by Date: ...
    (comp.lang.javascript)
  • Re: beginner: regex how to check that value is only numbers
    ... ignorant generally intend. ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ... Prev by Date: ...
    (comp.lang.javascript)
  • Re: get ip
    ... ISTM you have a colon too many. ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ... Prev by Date: ...
    (microsoft.public.scripting.jscript)
  • Re: number of times a character occurs in a string
    ... Randy Webb posted: ... ISTM that return +res.length should do for those 2 lines. ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ...
    (comp.lang.javascript)
  • Re: time zone
    ... One need only go back by the 0..6 days given by getDay() from the last ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ... Prev by Date: ...
    (comp.lang.javascript)

Loading