<?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: Easy Date parsing with JavaScript</title>
	<atom:link href="http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/</link>
	<description>Escalator Temporarily Stairs</description>
	<lastBuildDate>Mon, 23 Aug 2010 09:13:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Joey</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-2282</link>
		<dc:creator>Joey</dc:creator>
		<pubDate>Thu, 11 Feb 2010 06:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-2282</guid>
		<description>I have implemented Peter&#039;s fix, and fixed another bug in the parsing.

Qrilka, I got a bad date in that example, but it was a different bad date. Maybe this fix will fix it for you too.

Anyway, I have moved the code to BitBucket.org, and you can find it at:

http://bitbucket.org/mazzarelli/js-date/downloads/</description>
		<content:encoded><![CDATA[<p>I have implemented Peter&#8217;s fix, and fixed another bug in the parsing.</p>
<p>Qrilka, I got a bad date in that example, but it was a different bad date. Maybe this fix will fix it for you too.</p>
<p>Anyway, I have moved the code to BitBucket.org, and you can find it at:</p>
<p><a href="http://bitbucket.org/mazzarelli/js-date/downloads/" rel="nofollow">http://bitbucket.org/mazzarelli/js-date/downloads/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joey</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-2280</link>
		<dc:creator>Joey</dc:creator>
		<pubDate>Wed, 10 Feb 2010 15:42:55 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-2280</guid>
		<description>I&#039;ll have to look into that. I still have some changes from Peter that I need to put into it to. Thanks.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll have to look into that. I still have some changes from Peter that I need to put into it to. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Qrilka</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-2277</link>
		<dc:creator>Qrilka</dc:creator>
		<pubDate>Wed, 10 Feb 2010 08:32:38 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-2277</guid>
		<description>console.log(Date.fromString(&#039;01/12/10&#039;, {order: &#039;DMY&#039;, strict:true}));
//Thu Dec 13 2001 00:00:00 GMT+0300 (MSK)

FAIL :(</description>
		<content:encoded><![CDATA[<p>console.log(Date.fromString(&#8216;01/12/10&#8242;, {order: &#8216;DMY&#8217;, strict:true}));<br />
//Thu Dec 13 2001 00:00:00 GMT+0300 (MSK)</p>
<p>FAIL <img src='http://joey.mazzarelli.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: une6</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-1962</link>
		<dc:creator>une6</dc:creator>
		<pubDate>Sun, 06 Dec 2009 12:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-1962</guid>
		<description>best function ever... i&#039;ve been looking for this ever since. good job :)</description>
		<content:encoded><![CDATA[<p>best function ever&#8230; i&#8217;ve been looking for this ever since. good job <img src='http://joey.mazzarelli.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joey</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-1258</link>
		<dc:creator>Joey</dc:creator>
		<pubDate>Tue, 31 Mar 2009 14:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-1258</guid>
		<description>Nathan:

This is actually something I like. It allows me to do &quot;math&quot; on dates easily.

I have enough comments here that I need to get around to implementing/fixing, and maybe when I finally do, I&#039;ll include that as an option to reject &quot;rubbish dates&quot;.

Thanks.</description>
		<content:encoded><![CDATA[<p>Nathan:</p>
<p>This is actually something I like. It allows me to do &#8220;math&#8221; on dates easily.</p>
<p>I have enough comments here that I need to get around to implementing/fixing, and maybe when I finally do, I&#8217;ll include that as an option to reject &#8220;rubbish dates&#8221;.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-1257</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Tue, 31 Mar 2009 11:07:05 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-1257</guid>
		<description>Hi, found a problem. If you put in 31/02/2009 (DMY) it changes it to the 3rd of March, which is essentially correct. But it should fail rather than seeming to make up a date. This will happen if you put more days than within a month for any rubbish date.</description>
		<content:encoded><![CDATA[<p>Hi, found a problem. If you put in 31/02/2009 (DMY) it changes it to the 3rd of March, which is essentially correct. But it should fail rather than seeming to make up a date. This will happen if you put more days than within a month for any rubbish date.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Snyder</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-1245</link>
		<dc:creator>Peter Snyder</dc:creator>
		<pubDate>Fri, 20 Mar 2009 21:32:56 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-1245</guid>
		<description>Thanks for this code.  I&#039;ve made a couple of additions to make the code with SQL date type 109, ie something like Dec 30 2006 12:38:54:840AM.

The difference is just a couple of lines.  Heres the patch, if you&#039;re interested (i&#039;d also be happy to email it, if you prefer)

--- date.js	2009-03-20 16:57:29.000000000 -0500
+++ date_new.js	2009-03-20 16:44:47.000000000 -0500
@@ -36,7 +36,7 @@
 
   var find_time = function (norm) {
     var obj = {date:norm, time:&#039;&#039;};
-    obj.time = norm.replace(/^.*-(\d\d?(:\d\d){1,2}(-(AM&#124;PM))?)-.*$/, &#039;$1&#039;);
+    obj.time = norm.replace(/^.*-(\d\d?(:\d\d){1,2}(:\d\d\d)?(-(AM&#124;PM))?)-.*$/, &#039;$1&#039;);
     if (obj.time == obj.date)
       obj.time = norm.replace(/^.*-(\d\d?-(AM&#124;PM))-.*$/, &#039;$1&#039;);
     if (obj.time == obj.date) obj.time = &#039;&#039;;
@@ -97,19 +97,20 @@
   };
 
   var create_absolute = function (obj) {
-    
     var time = obj.time.replace(/[-APM]/g, &#039;&#039;);
     var parts = time.split(&#039;:&#039;);
     parts[1] = parts[1] &#124;&#124; 0;
-    parts[2] = parts[2] &#124;&#124; 0;
+    parts[2] = parts[2] &#124;&#124; 0;    
+    parts[3] = parts[3] &#124;&#124; 0;
     var ihr = parseInt(parts[0], 10);
     if (obj.time.match(/-AM-/) &amp;&amp; ihr == 12) parts[0] = 0;
     else if (obj.time.match(/-PM-/) &amp;&amp; ihr &lt; 12) parts[0] = ihr + 12;
     parts[0] = (&quot;0&quot; + parts[0]).substring((&quot;0&quot; + parts[0]).length - 2);
     parts[1] = (&quot;0&quot; + parts[1]).substring((&quot;0&quot; + parts[1]).length - 2);
     parts[2] = (&quot;0&quot; + parts[2]).substring((&quot;0&quot; + parts[2]).length - 2);
-    time = parts.join(&#039;:&#039;);
-
+    time = parts[0]+&quot;:&quot;+parts[1]+&quot;:&quot;+parts[2];
+	var	millisecs = parts[3];
+	
     var strict = defaults.opts.strict;
     if (!obj.year &amp;&amp; !strict) obj.year = (new Date()).getFullYear();
     var year = parseInt(obj.year, 10);
@@ -129,6 +130,7 @@
 
     var date = new Date();
     date.setTime(Date.parse(year + &#039;/&#039; + month + &#039;/&#039; + day + &#039; &#039; + time));
+    date.setMilliseconds(millisecs);
     return date;
   };</description>
		<content:encoded><![CDATA[<p>Thanks for this code.  I&#8217;ve made a couple of additions to make the code with SQL date type 109, ie something like Dec 30 2006 12:38:54:840AM.</p>
<p>The difference is just a couple of lines.  Heres the patch, if you&#8217;re interested (i&#8217;d also be happy to email it, if you prefer)</p>
<p>&#8212; date.js	2009-03-20 16:57:29.000000000 -0500<br />
+++ date_new.js	2009-03-20 16:44:47.000000000 -0500<br />
@@ -36,7 +36,7 @@</p>
<p>   var find_time = function (norm) {<br />
     var obj = {date:norm, time:&#8221;};<br />
-    obj.time = norm.replace(/^.*-(\d\d?(:\d\d){1,2}(-(AM|PM))?)-.*$/, &#8216;$1&#8242;);<br />
+    obj.time = norm.replace(/^.*-(\d\d?(:\d\d){1,2}(:\d\d\d)?(-(AM|PM))?)-.*$/, &#8216;$1&#8242;);<br />
     if (obj.time == obj.date)<br />
       obj.time = norm.replace(/^.*-(\d\d?-(AM|PM))-.*$/, &#8216;$1&#8242;);<br />
     if (obj.time == obj.date) obj.time = &#8221;;<br />
@@ -97,19 +97,20 @@<br />
   };</p>
<p>   var create_absolute = function (obj) {<br />
-<br />
     var time = obj.time.replace(/[-APM]/g, &#8221;);<br />
     var parts = time.split(&#8216;:&#8217;);<br />
     parts[1] = parts[1] || 0;<br />
-    parts[2] = parts[2] || 0;<br />
+    parts[2] = parts[2] || 0;<br />
+    parts[3] = parts[3] || 0;<br />
     var ihr = parseInt(parts[0], 10);<br />
     if (obj.time.match(/-AM-/) &amp;&amp; ihr == 12) parts[0] = 0;<br />
     else if (obj.time.match(/-PM-/) &amp;&amp; ihr &lt; 12) parts[0] = ihr + 12;<br />
     parts[0] = (&#8220;0&#8243; + parts[0]).substring((&#8220;0&#8243; + parts[0]).length &#8211; 2);<br />
     parts[1] = (&#8220;0&#8243; + parts[1]).substring((&#8220;0&#8243; + parts[1]).length &#8211; 2);<br />
     parts[2] = (&#8220;0&#8243; + parts[2]).substring((&#8220;0&#8243; + parts[2]).length &#8211; 2);<br />
-    time = parts.join(&#8216;:&#8217;);<br />
-<br />
+    time = parts[0]+&#8221;:&#8221;+parts[1]+&#8221;:&#8221;+parts[2];<br />
+	var	millisecs = parts[3];<br />
+<br />
     var strict = defaults.opts.strict;<br />
     if (!obj.year &amp;&amp; !strict) obj.year = (new Date()).getFullYear();<br />
     var year = parseInt(obj.year, 10);<br />
@@ -129,6 +130,7 @@</p>
<p>     var date = new Date();<br />
     date.setTime(Date.parse(year + &#8216;/&#8217; + month + &#8216;/&#8217; + day + &#8216; &#8216; + time));<br />
+    date.setMilliseconds(millisecs);<br />
     return date;<br />
   };</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: esoseRirl</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-1208</link>
		<dc:creator>esoseRirl</dc:creator>
		<pubDate>Tue, 24 Feb 2009 19:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-1208</guid>
		<description>Thank you!</description>
		<content:encoded><![CDATA[<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thor</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-1189</link>
		<dc:creator>Thor</dc:creator>
		<pubDate>Sun, 01 Feb 2009 12:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-1189</guid>
		<description>you could run the date through this code to have a check against real date

http://snipplr.com/view/7875/javascript-validate-date/</description>
		<content:encoded><![CDATA[<p>you could run the date through this code to have a check against real date</p>
<p><a href="http://snipplr.com/view/7875/javascript-validate-date/" rel="nofollow">http://snipplr.com/view/7875/javascript-validate-date/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Lateral</title>
		<link>http://joey.mazzarelli.com/2008/11/25/easy-date-parsing-with-javascript/#comment-1175</link>
		<dc:creator>John Lateral</dc:creator>
		<pubDate>Wed, 17 Dec 2008 14:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://joey.mazzarelli.com/?p=80#comment-1175</guid>
		<description>Why is: 

MDY
12/50/2004

accepted as a valid date? The 50. december does not - as far as I know - exist in any normal calendar. Is it possible to have the function only accept VALID dates?</description>
		<content:encoded><![CDATA[<p>Why is: </p>
<p>MDY<br />
12/50/2004</p>
<p>accepted as a valid date? The 50. december does not &#8211; as far as I know &#8211; exist in any normal calendar. Is it possible to have the function only accept VALID dates?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
