<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Get the week number with JavaScript</title>
	<atom:link href="http://syn.ac/tech/19/get-the-weeknumber-with-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/</link>
	<description>Syn.acK - Reviews and help about anything</description>
	<lastBuildDate>Mon, 07 Nov 2011 19:25:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Julien de Prabère</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-208</link>
		<dc:creator>Julien de Prabère</dc:creator>
		<pubDate>Mon, 07 Nov 2011 19:25:18 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-208</guid>
		<description>After cheks, your program does not need a correction for summer time but is wrong, for example in 2010, with one week too much all year long...</description>
		<content:encoded><![CDATA[<p>After cheks, your program does not need a correction for summer time but is wrong, for example in 2010, with one week too much all year long&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julien de Prabère</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-207</link>
		<dc:creator>Julien de Prabère</dc:creator>
		<pubDate>Mon, 07 Nov 2011 01:02:50 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-207</guid>
		<description>I propose this function, which takes into account the summer(daylight saving) time !

Date.prototype.getWeek = function() {var i,d,firstWeekMonday;
	var i=1;while (new Date(this.getFullYear(),0,i).getDay()!=4) i++;// i the first Thursday;
	var firstWeekMonday = new Date(this.getFullYear(),0,i-3,0,0,0,-1);// one millisecond before 
	d=Math.ceil(((this.valueOf()-firstWeekMonday.valueOf()-(this.getTimezoneOffset()-firstWeekMonday.getTimezoneOffset())*60000)/86400000)/7);
	return d?d:new Date(this.getFullYear()-1,11,31).getWeek();
}</description>
		<content:encoded><![CDATA[<p>I propose this function, which takes into account the summer(daylight saving) time !</p>
<p>Date.prototype.getWeek = function() {var i,d,firstWeekMonday;<br />
	var i=1;while (new Date(this.getFullYear(),0,i).getDay()!=4) i++;// i the first Thursday;<br />
	var firstWeekMonday = new Date(this.getFullYear(),0,i-3,0,0,0,-1);// one millisecond before<br />
	d=Math.ceil(((this.valueOf()-firstWeekMonday.valueOf()-(this.getTimezoneOffset()-firstWeekMonday.getTimezoneOffset())*60000)/86400000)/7);<br />
	return d?d:new Date(this.getFullYear()-1,11,31).getWeek();<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ray</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-195</link>
		<dc:creator>ray</dc:creator>
		<pubDate>Fri, 04 Feb 2011 16:48:38 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-195</guid>
		<description>I been looking for a weekly script. What is the code to display the current week on the page. document.write?

thx</description>
		<content:encoded><![CDATA[<p>I been looking for a weekly script. What is the code to display the current week on the page. document.write?</p>
<p>thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lasse Ebert</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-180</link>
		<dc:creator>Lasse Ebert</dc:creator>
		<pubDate>Tue, 05 Oct 2010 22:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-180</guid>
		<description>Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Monty</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-175</link>
		<dc:creator>Monty</dc:creator>
		<pubDate>Sat, 04 Sep 2010 19:19:44 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-175</guid>
		<description>It doesnt work, for the date of 9/4/2010 it gives 35, its 36....</description>
		<content:encoded><![CDATA[<p>It doesnt work, for the date of 9/4/2010 it gives 35, its 36&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NielsNL</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-170</link>
		<dc:creator>NielsNL</dc:creator>
		<pubDate>Wed, 12 May 2010 14:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-170</guid>
		<description>Thankyou very much needed this badly</description>
		<content:encoded><![CDATA[<p>Thankyou very much needed this badly</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimbo</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-146</link>
		<dc:creator>Jimbo</dc:creator>
		<pubDate>Thu, 04 Mar 2010 09:26:38 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-146</guid>
		<description>VDE is correct, the last week of 2009 and first week of 2010 are technically the same week number (if im not mistaken, that would be week 53) And week 1 of 2010 should start on 3 Jan 2010</description>
		<content:encoded><![CDATA[<p>VDE is correct, the last week of 2009 and first week of 2010 are technically the same week number (if im not mistaken, that would be week 53) And week 1 of 2010 should start on 3 Jan 2010</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praveen</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-141</link>
		<dc:creator>Praveen</dc:creator>
		<pubDate>Tue, 16 Feb 2010 10:04:17 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-141</guid>
		<description>Thanks, this function is very useful</description>
		<content:encoded><![CDATA[<p>Thanks, this function is very useful</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-131</link>
		<dc:creator>Andrey</dc:creator>
		<pubDate>Fri, 15 May 2009 12:51:17 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-131</guid>
		<description>Very useful function. Thank you.</description>
		<content:encoded><![CDATA[<p>Very useful function. Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vde</title>
		<link>http://syn.ac/tech/19/get-the-weeknumber-with-javascript/comment-page-1/#comment-129</link>
		<dc:creator>vde</dc:creator>
		<pubDate>Mon, 27 Apr 2009 12:28:51 +0000</pubDate>
		<guid isPermaLink="false">http://syn.ac/common/19/get-the-weeknumber-with-javascript/#comment-129</guid>
		<description>Hi.

I tried your script but I found a bug.

The 2009-12-31 return 53th week,
but 2010-01-01 return 01 week against 53th week.

The transition between 2 years must test the number of day of the first week. 
If 2010-01-01 &gt;= friday then first week begin the next monday.</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>I tried your script but I found a bug.</p>
<p>The 2009-12-31 return 53th week,<br />
but 2010-01-01 return 01 week against 53th week.</p>
<p>The transition between 2 years must test the number of day of the first week.<br />
If 2010-01-01 &gt;= friday then first week begin the next monday.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

