Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Dr J R Stockton Newsgroups: comp.lang.javascript Subject: Re: toString Method with Parameters Date: Sat, 17 Dec 2011 20:59:04 +0000 Organization: Home Lines: 33 Message-ID: References: <4g1de7t607d0sdudjmdv4mr1o4cm5hvekg@4ax.com> <9qpAjQP5i75OFw+H@invalid.uk.co.demon.merlyn.invalid> <74fle7tvc61qitmcrhv85mq0ovi1qpf11g@4ax.com> Mime-Version: 1.0 Content-Type: text/plain;charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="UwYDIHu13GPq28RciNoAJA"; logging-data="21883"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19E0cOqHFyMRl5ZtxKaKjLPeg2xAbo+8kU=" User-Agent: Turnpike/6.05-S () Cancel-Lock: sha1:nm6XWuKOkXLf4fQl9VLiDj4FGrM= Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:9354 In comp.lang.javascript message <74fle7tvc61qitmcrhv85mq0ovi1qpf11g@4ax. com>, Thu, 15 Dec 2011 19:45:25, Gene Wirchenko posted: > I have to add and subtract months, too. Date arithmetic can be >rather interesting when dealing with the end of the month. What is >one month after September 29? October 29. What is one month after >September 30? One can argue October 30 or October 31. I go with the >latter. No justification for choosing Oct 31, unless you have it in writing signed by the Boss. The last day of September is really October 0, which works for all Gregorian months. One month ahead of August 31 is more interesting - September 30 or October 1. IIRC, I have a month-incrementing routine to handle that. You should persuade the company to use ISO 8601 Week-Numbering dates instead. It saves a digit, and years have only two lengths in days whereas months have four. You probably know that an IE page can include both JavaScript and VBscript. VBScript has DatePart, which can give ISO 8601 Week Numbers, and gets it right for all but 13 dates in every 400 years. MS have known about this for years, and have a truly horrible piece of code to use instead. Of course, ISO is International, which means Foreign Down South, and true American coders don't care for foreign standards. Any of them who wants a standard just makes his own. -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web - FAQqish topics, acronyms and links; Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc. No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.