<?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: JavaScript date parsing and formatting, Part 1</title>
	<atom:link href="http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/</link>
	<description>Stay curious!</description>
	<lastBuildDate>Thu, 09 Feb 2012 09:56:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Clarence Fredericks</title>
		<link>http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/#comment-19119</link>
		<dc:creator>Clarence Fredericks</dc:creator>
		<pubDate>Mon, 07 Feb 2011 16:34:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=66#comment-19119</guid>
		<description>As far as parsing a date, I would simply use the date object constructor.  On the other hand, I came across a brand new JavaScript library called jPaq which provides a function that closely emulates PHP&#039;s date function.  Documentation for this function can be found here:  http://jpaq.org/documentation/Date.prototype.format%28%29/1.0/.  The best thing about the library is the fact that you can download your own build which contains only the code that you will need.</description>
		<content:encoded><![CDATA[<p>As far as parsing a date, I would simply use the date object constructor.  On the other hand, I came across a brand new JavaScript library called jPaq which provides a function that closely emulates PHP&#8217;s date function.  Documentation for this function can be found here:  <a href="http://jpaq.org/documentation/Date.prototype.format%28%29/1.0/" rel="nofollow">http://jpaq.org/documentation/Date.prototype.format%28%29/1.0/</a>.  The best thing about the library is the fact that you can download your own build which contains only the code that you will need.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaxon</title>
		<link>http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/#comment-18958</link>
		<dc:creator>Jaxon</dc:creator>
		<pubDate>Sun, 28 Nov 2010 06:31:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=66#comment-18958</guid>
		<description>I&#039;ve started using this library for date formatting:  

http://plugins.jquery.com/project/fIsForFormat 

(I don&#039;t know why they have it as a jQuery plugin - it isn&#039;t!)

It has some really neat features and actually works well in tandem with Xaprb&#039;s parser.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve started using this library for date formatting:  </p>
<p><a href="http://plugins.jquery.com/project/fIsForFormat" rel="nofollow">http://plugins.jquery.com/project/fIsForFormat</a> </p>
<p>(I don&#8217;t know why they have it as a jQuery plugin &#8211; it isn&#8217;t!)</p>
<p>It has some really neat features and actually works well in tandem with Xaprb&#8217;s parser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/#comment-15157</link>
		<dc:creator>Xaprb</dc:creator>
		<pubDate>Thu, 02 Oct 2008 14:24:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=66#comment-15157</guid>
		<description>This project&#039;s new home page is at http://code.google.com/p/flexible-js-formatting/</description>
		<content:encoded><![CDATA[<p>This project&#8217;s new home page is at <a href="http://code.google.com/p/flexible-js-formatting/" rel="nofollow">http://code.google.com/p/flexible-js-formatting/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tracker1</title>
		<link>http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/#comment-14916</link>
		<dc:creator>tracker1</dc:creator>
		<pubDate>Wed, 30 Jul 2008 23:31:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=66#comment-14916</guid>
		<description>Hmm, the regexp didn&#039;t come out right there... replaced the plus signs. (grr)  the \.\d should have a plus sign after it not a literal space... there is also a missing plus elsewhere... if you email me, I will send you it in text.</description>
		<content:encoded><![CDATA[<p>Hmm, the regexp didn&#8217;t come out right there&#8230; replaced the plus signs. (grr)  the \.\d should have a plus sign after it not a literal space&#8230; there is also a missing plus elsewhere&#8230; if you email me, I will send you it in text.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tracker1</title>
		<link>http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/#comment-14915</link>
		<dc:creator>tracker1</dc:creator>
		<pubDate>Wed, 30 Jul 2008 23:29:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=66#comment-14915</guid>
		<description>I pre-pended the following inside your Date.parseDate function, so I could account for dates that come from my database as a string, as well as getting a Date() object back from the generic Date.parse when there is no format... since Date.parse returns a TIME_T value, instead of a Date() object...

//check for DB ISO-Style DateTime first...
var isoDate = /(\d{4}\-\d{2}\-\d{2}(&#124;(T&#124; )\d{2}\:\d{2}\:\d{2}(&#124;\.\d )(&#124;(&#124; )(&#124;\-&#124;\ )(&#124;\d{2}(\:&#124;)\d{2}))))/i
	if (isoDate.test(input))
		return new Date(input.replace(/-/,&quot;/&quot;).replace(/-/,&quot;/&quot;).replace(/[TZ]/,&quot; &quot;).replace(/(\.\d )/,&quot; &quot;));
	else if (!(format))
		return new Date(Date.parse(input));</description>
		<content:encoded><![CDATA[<p>I pre-pended the following inside your Date.parseDate function, so I could account for dates that come from my database as a string, as well as getting a Date() object back from the generic Date.parse when there is no format&#8230; since Date.parse returns a TIME_T value, instead of a Date() object&#8230;</p>
<p>//check for DB ISO-Style DateTime first&#8230;<br />
var isoDate = /(\d{4}\-\d{2}\-\d{2}(|(T| )\d{2}\:\d{2}\:\d{2}(|\.\d )(|(| )(|\-|\ )(|\d{2}(\:|)\d{2}))))/i<br />
	if (isoDate.test(input))<br />
		return new Date(input.replace(/-/,&#8221;/&#8221;).replace(/-/,&#8221;/&#8221;).replace(/[TZ]/,&#8221; &#8220;).replace(/(\.\d )/,&#8221; &#8220;));<br />
	else if (!(format))<br />
		return new Date(Date.parse(input));</p>
]]></content:encoded>
	</item>
</channel>
</rss>

