<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><!-- generator="wordpress/2.3.2" --><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Datejs - A JavaScript Date Library</title>
	<link>http://www.datejs.com</link>
	<description>An open-source JavaScript Date Library</description>
	<pubDate>Fri, 06 Jun 2008 05:27:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/datejs" type="application/rss+xml" /><item>
		<title>New .same() function, but is it useful?</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/289791035/</link>
		<comments>http://www.datejs.com/2008/05/13/new-same-function-but-is-it-useful/#comments</comments>
		<pubDate>Tue, 13 May 2008 23:59:12 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2008/05/13/new-same-function-but-is-it-useful/</guid>
		<description><![CDATA[I need some feedback regarding a feature I just added to the library, but I&#8217;m struggling to explain/document clearly and I&#8217;m not sure if others would find this useful.
The new .same() function will compare two date objects to determine if they occur on/in exactly the same instance of the given date part. (&#8230;like I said, [...]]]></description>
			<content:encoded><![CDATA[<p>I need some feedback regarding a feature I just added to the library, but I&#8217;m struggling to explain/document clearly and I&#8217;m not sure if others would find this useful.</p>
<p>The new .same() function will compare two date objects to determine if they occur on/in exactly the same instance of the given date part. (&#8230;like I said, I&#8217;m having a hard time explaining this one).</p>
<p>It&#8217;s easier to understand with code&#8230;</p>
<p><strong>Scenario:</strong> Determine if the two dates occur on the same day. </p>
<p><strong>Example</strong></p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">var</span> d1 = Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="co1">// today at 00:00</span><br />
<span class="kw2">var</span> d2 = <span class="kw2">new</span> Date<span class="br0">&#40;</span><span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// exactly now.</span></p>
<p><span class="co1">// Do they occur on the same day?</span><br />
d1.<span class="me1">same</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">day</span><span class="br0">&#40;</span>d2<span class="br0">&#41;</span>; <span class="co1">// true</span></p>
<p><span class="co1">// What if it&#8217;s the same day, but one year apart?</span><br />
<span class="kw2">var</span> nextYear = Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">add</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>.<span class="me1">year</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>d1.<span class="me1">same</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">day</span><span class="br0">&#40;</span>nextYear<span class="br0">&#41;</span>; <span class="co1">// false, because the dates must occur on the exact same day. </span><br />
&nbsp;</div>
</div>
<p>When comparing the dates in the same above, the .same() function will test that the year, month, and day match. Because we&#8217;re only interested in whether the day is the same, the hour, minute, second &#038; millisecond values are ignored.</p>
<p>Using the same d1 &#038; d2 values from above, determine if the two dates occur on the same hour. </p>
<p><strong>Example</strong></p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">// Do they occur on the same hour?</span><br />
d1.<span class="me1">same</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">hour</span><span class="br0">&#40;</span>d2<span class="br0">&#41;</span>; <span class="co1">// false, unless d2 hour is &#8216;00&#8242; (&lt; 1:00 am). </span><br />
&nbsp;</div>
</div>
<p>If no date is passed as a parameter, by default the .same() function will use &#8216;Now&#8217; (new Date()) as the default date to compare against.</p>
<p><strong>Example</strong></p>
<div class="codesnip-container" >
<div class="codesnip">Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">same</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">day</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="co1">// true, &#8216;today&#8217; occurs on &#8216;today&#8217;</span><br />
Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">same</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">hour</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="co1">// false, unless &#8216;now&#8217; is &#8216;00&#8242; minutes (&lt; 1:00am) </span><br />
&nbsp;</div>
</div>
<p>What do think? Would you find this functionality useful?</p>
<p>I do&#8230; because I&#8217;m often trying to determine if some date object occurs during today. The following samples demonstrate various ways to determine if a date object occurs today.</p>
<p><strong>Example (native JavaScript, without Datejs)</strong></p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">var</span> temp = <span class="kw2">new</span> Date<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
temp.<span class="me1">setHours</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
temp.<span class="me1">setMinutes</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
temp.<span class="me1">setSeconds</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
temp.<span class="me1">setMilliseconds</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;</p>
<p><span class="kw2">var</span> today = <span class="kw2">new</span> Date<span class="br0">&#40;</span>someDate.<span class="me1">getTime</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="co1">// clone original instance so we don&#8217;t actually change the original date. </span><br />
<span class="kw2">var</span> today.<span class="me1">setHours</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> today.<span class="me1">setMinutes</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> today.<span class="me1">setSeconds</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> today.<span class="me1">setMilliseconds</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;</p>
<p><span class="br0">&#40;</span>today == temp<span class="br0">&#41;</span>; <span class="co1">// true|false </span><br />
&nbsp;</div>
</div>
<p><strong>Example (with Datejs)</strong></p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">// with Datejs, but without .same</span><br />
someDate.<span class="me1">clone</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">clearTime</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">equals</span><span class="br0">&#40;</span>Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// New</span><br />
someDate.<span class="me1">same</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">day</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// Or, </span><br />
someDate.<span class="kw1">is</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</div>
<p>Checking if a given date object occurs today is easy enough with Datejs and would not really justify adding the new .same() functionality, but things can get nasty when you need to compare against a date other than &#8216;today&#8217;.</p>
<p><strong>Scenario:</strong> Determine if a given date occurs during some week period 2 months from now. </p>
<p><strong>Example</strong></p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">// New</span><br />
<span class="kw2">var</span> future = Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">add</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span>.<span class="me1">months</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="kw1">return</span> someDate.<span class="me1">same</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">week</span><span class="br0">&#40;</span>future<span class="br0">&#41;</span>; <span class="co1">// true|false; </span><br />
&nbsp;</div>
</div>
<p>The .same() function adds a third context to .second() within the library, which enables the following interesting (but freakishly cryptic) logic.</p>
<p><strong>Example</strong></p>
<div class="codesnip-container" >
<div class="codesnip">Date.<span class="me1">jan</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">second</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">monday</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">add</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>.<span class="me1">second</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">same</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">second</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</div>
<p>The .same() functionality has been added to sugarpak.js and is available from <a href="http://www.datejs.com/svn/">SVN</a>.</p>
<p>Any feedback is appreciated.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=0sQhnS"><img src="http://feeds.feedburner.com/~a/datejs?i=0sQhnS" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2008/05/13/new-same-function-but-is-it-useful/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2008/05/13/new-same-function-but-is-it-useful/</feedburner:origLink></item>
		<item>
		<title>Refreshed Documentation</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/269783503/</link>
		<comments>http://www.datejs.com/2008/04/13/refreshed-documentation/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 04:33:04 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[News]]></category>

		<category><![CDATA[documentation]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2008/04/13/refreshed-documentation/</guid>
		<description><![CDATA[For the last couple months updates to the library have been consistently happening every 3-4 days with new features, bug fixes or edits being committed to SVN. The last few days in particular have seen an epic refresh to the project with updates across all modules.
View CHANGELOG
With all the recent changes the docs have gotten [...]]]></description>
			<content:encoded><![CDATA[<p>For the last couple months updates to the library have been consistently happening every 3-4 days with new features, bug fixes or edits being committed to <a href="http://www.datejs.com/svn/">SVN</a>. The last few days in particular have seen an epic refresh to the project with updates across all modules.</p>
<p>View <a href="http://www.datejs.com/changelog/">CHANGELOG</a></p>
<p>With all the recent changes the docs have gotten a little out of sync, so today I finally sat down to make sure all the core.js docs were correct both online (<a href="http://www.datejs.com/documentation/">wiki</a>) and inline. Along with sync I also created a new documentation style for the <a href="http://www.datejs.com/documentation/">online wiki docs</a>.</p>
<p><strong>New Documentation Sample</strong><br />
<a href="http://www.datejs.com/docs/"><img style="padding: 1px; border: 1px solid #7F9DB9;" src='http://www.datejs.com/wp-content/uploads/2008/04/new-datejs-documentation-style.gif' alt='new-datejs-documentation-style.gif' /></a></p>
<p>Each function is now documented with the following features:</p>
<ul>
<li>A description of the function</li>
<li>Parameters are listed with Type, Name and Description</li>
<li>Return Value is listed with the Type, Sample and Description</li>
<li>At least one code sample demonstrating how to use the function</li>
</ul>
<p>Documenting <a href="http://www.datejs.com/svn/sugarpak/">sugarpak.js</a> is up next.</p>
<p>Hope this helps.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=EYwJPU"><img src="http://feeds.feedburner.com/~a/datejs?i=EYwJPU" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2008/04/13/refreshed-documentation/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2008/04/13/refreshed-documentation/</feedburner:origLink></item>
		<item>
		<title>Need feedback from Arabic, Chinese and several other cultures</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/232952374/</link>
		<comments>http://www.datejs.com/2008/02/10/need-feedback-from-arabic-chinese-and-several-other-cultures/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 05:17:05 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2008/02/10/need-feedback-from-arabic-chinese-and-several-other-cultures/</guid>
		<description><![CDATA[In preparation for an official final Release Version 1.0 within a month or two, we&#8217;re just about to stamp the current Datejs code in SVN as Beta. 
But&#8230; we need some help. One area where we have not received much feedback is testing the Parser with cultures/languages outside of English.
The Datejs library should properly parse [...]]]></description>
			<content:encoded><![CDATA[<p>In preparation for an official final Release Version 1.0 within a month or two, we&#8217;re just about to stamp the current Datejs code in <a href="http://www.datejs.com/svn/">SVN</a> as Beta. </p>
<p>But&#8230; we need some help. One area where we have not received much feedback is testing the Parser with cultures/languages outside of English.</p>
<p>The Datejs library should properly parse month and day names (both full and abbreviated strings) in over 150 different cultures. </p>
<p>The variations of German, Spanish, French and most European culture parsing seem good.</p>
<p>The big unknown cultures are Arabic and Chinese.</p>
<p>Haven&#8217;t heard much feedback from India either.</p>
<p>The following list details the cultures we&#8217;re most interested in receiving feedback:</p>
<ul>
<li><a href="http://datejs.googlecode.com/svn/trunk/build/date-ar-SA.js">Arabic (Saudi Arabia) date-ar-SA.js (or any other Arabic culture)</a></li>
<li><a href="http://datejs.googlecode.com/svn/trunk/build/date-zh-CN.js">Chinese (People&#8217;s Republic of China) date-zh-CN.js</a></li>
<li><a href="http://datejs.googlecode.com/svn/trunk/build/date-pa-IN.js">Punjabi (India) date-pa-IN.js</a></li>
<li><a href="http://datejs.googlecode.com/svn/trunk/build/date-ru-RU.js">Russian (Russia) date-ru-RU.js</a></li>
<li><a href="http://datejs.googlecode.com/svn/trunk/build/date-th-TH.js">Thai (Thailand) date-th-TH.js</a></li>
</ul>
<p>If any developers could confirm the Datejs Parser is working (or not) in any of the above cultures, we would really appreciate the thumbs up/down. <strong>By &#8220;<em>working</em>&#8220;, we&#8217;re specifically interested in whether the Parser is correctly parsing Day and Month names in each culture and whether the  expected date format for that culture parses properly</strong>.</p>
<p>If the following strings (translated into the appropriate language) return the proper date, things should be good. </p>
<p><strong>Example</strong></p>
<div class="codesnip-container" >
<div class="codesnip">Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;July 2008&#8242;</span><span class="br0">&#41;</span>;<br />
Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;Sat July 3, 2004&#8242;</span><span class="br0">&#41;</span>;<br />
Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;Dec&#8217;</span><span class="br0">&#41;</span>;<br />
Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;monday&#8217;</span><span class="br0">&#41;</span>;</div>
</div>
<p>The parser ships with some date phrase support (eg. &#8216;today&#8217;, &#8216;next march&#8217;), although those strings may require translation. A couple cultures have already been translated by the community and available for download from the Datejs forums. </p>
<ul>
<li><a href="http://datejs.googlegroups.com/web/fr-FR.js?gda=yvqRPDkAAACj4pfxnMAccUJgWAAm-fNY6SzurZOCWQd0m4PLNpJn92G1qiJ7UbTIup-M2XPURDQL8fBfGGAKs4SAK81ZMSOW">français-French (France)</a></li>
<li><a href="http://datejs.googlegroups.com/web/es-ES.js?gda=ziWqPjkAAACj4pfxnMAccUJgWAAm-fNY6SzurZOCWQd0m4PLNpJn92G1qiJ7UbTIup-M2XPURDS5f9oo1MROwnxkoNkL7Kbg">espanol-Spanish (Spain)</a></li>
</ul>
<p>To test your culture, download a culture-specific file from SVN /trunk/build/ and add to any web page. If you are using FireFox, the easiest way run test scripts is with <a href="http://www.getfirebug.com/">FireBug</a>.</p>
<p>Thanks for the help.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=VrwUlK"><img src="http://feeds.feedburner.com/~a/datejs?i=VrwUlK" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2008/02/10/need-feedback-from-arabic-chinese-and-several-other-cultures/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2008/02/10/need-feedback-from-arabic-chinese-and-several-other-cultures/</feedburner:origLink></item>
		<item>
		<title>Advice on Datejs compression and performance tuning</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/220926084/</link>
		<comments>http://www.datejs.com/2008/01/22/advice-on-datejs-compression-and-performance-tuning/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 11:38:48 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2008/01/22/advice-on-datejs-compression-and-performance-tuning/</guid>
		<description><![CDATA[Guy Fraser recently chronicled a series of his recommendations for Datejs compression and performance enhancements. Check it out.
One recommendation from Guy was to hold a reference to the Date.prototype in a local var, thereby saving characters and simplifying access to the prototype.
Example

&#40;function &#40;&#41; &#123;
&#160; &#160; // Store prototype in local variable making
&#160; &#160; // syntax [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.adaptavist.com/display/~gfraser/2008/01/12/DateJS%2C+Compression%2C+Performance">Guy Fraser</a> recently chronicled a series of his recommendations for Datejs compression and performance enhancements. <a href="https://www.adaptavist.com/display/~gfraser/2008/01/12/DateJS%2C+Compression%2C+Performance">Check it out</a>.</p>
<p>One recommendation from Guy was to hold a reference to the Date.prototype in a local <code>var</code>, thereby saving characters and simplifying access to the prototype.</p>
<p><strong>Example</strong></p>
<div class="codesnip-container" >
<div class="codesnip"><span class="br0">&#40;</span><span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">// Store prototype in local variable making</span><br />
&nbsp; &nbsp; <span class="co1">// syntax shorter and access faster.</span><br />
&nbsp; &nbsp; <span class="kw2">var</span> $P = Date.<span class="me1">prototype</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">// Old</span><br />
&nbsp; &nbsp; <span class="co1">// Date.prototype.clearTime = function() {</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">// New</span><br />
&nbsp; &nbsp; $P.<span class="me1">clearTime</span> = <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">setHours</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">setMinutes</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">setSeconds</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">setMilliseconds</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">this</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span>;&nbsp; &nbsp; <br />
<span class="br0">&#125;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</div>
<p>After changing everything over we were able to shave a little over 1k off the total library size and our performance tests did register an improvement. Great advice, and Datejs is now better (and faster!).</p>
<p>All this has been checked into <a href="http://www.datejs.com/svn/">SVN</a> for public consumption.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=YIFMsv"><img src="http://feeds.feedburner.com/~a/datejs?i=YIFMsv" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2008/01/22/advice-on-datejs-compression-and-performance-tuning/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2008/01/22/advice-on-datejs-compression-and-performance-tuning/</feedburner:origLink></item>
		<item>
		<title>Ajaxorized sliding date-picker</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/220914764/</link>
		<comments>http://www.datejs.com/2008/01/22/ajaxorized-sliding-date-picker/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 11:17:58 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2008/01/22/ajaxorized-sliding-date-picker/</guid>
		<description><![CDATA[Willem from Ajaxorized has just glued together Prototype, Scriptaculous and Datejs to create a super cool sliding date-picker widget. 
Check it out.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://ajaxorized.com/introducing-the-sliding-date-picker/" style="padding: 0 0 8px 8px; float:right;"><img src='http://www.datejs.com/wp-content/uploads/2008/01/sliderscreenie.jpg' alt='sliderscreenie.jpg' style="border: 1px solid #666; padding: 2px;" /></a>Willem from <a href="http://www.ajaxorized.com/">Ajaxorized</a> has just glued together Prototype, Scriptaculous and Datejs to create a super cool sliding date-picker widget. </p>
<p><a href="http://ajaxorized.com/introducing-the-sliding-date-picker/">Check it out</a>.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=HMm5kP"><img src="http://feeds.feedburner.com/~a/datejs?i=HMm5kP" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2008/01/22/ajaxorized-sliding-date-picker/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2008/01/22/ajaxorized-sliding-date-picker/</feedburner:origLink></item>
		<item>
		<title>CrazyEgg Confetti report…</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/198710304/</link>
		<comments>http://www.datejs.com/2007/12/11/crazyegg-confetti-report/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 16:11:41 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2007/12/11/crazyegg-confetti-report/</guid>
		<description><![CDATA[Over the weekend we ran a test with CrazyEgg to get a sense of what visitors were clicking on. We were pretty sure the &#8220;Mad Skillz&#8221; widget was a popular first stop for most, but wow! 
The CrazyEgg Confetti report confirmed our hunch.

[See full report]
I have a few ideas on how to improve the &#8220;Mad [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend we ran a test with <a href="http://www.crazyegg.com/">CrazyEgg</a> to get a sense of what visitors were clicking on. We were pretty sure the &#8220;Mad Skillz&#8221; widget was a popular first stop for most, but <strong>wow</strong>! </p>
<p>The CrazyEgg Confetti report confirmed our hunch.</p>
<p><a href="http://www.datejs.com/wp-content/uploads/2007/12/datejs_confetti_full.jpg"><img src='http://www.datejs.com/wp-content/uploads/2007/12/crazyegg_confetti.jpg' alt='CrazyEgg Confetti detail' /></a><br />
[<a href="http://www.datejs.com/wp-content/uploads/2007/12/datejs_confetti_full.jpg">See full report</a>]</p>
<p>I have a few ideas on how to improve the &#8220;<strong><em>Mad Skillz</em></strong>&#8221; widget and maybe we&#8217;ll make it an even bigger focus on the home page. I&#8217;d also like to figure out a way to start capturing any parse failures. A simple button which would do a one-click submit and email us the contents of the input field should be easy to implement.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=JWigYP"><img src="http://feeds.feedburner.com/~a/datejs?i=JWigYP" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2007/12/11/crazyegg-confetti-report/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2007/12/11/crazyegg-confetti-report/</feedburner:origLink></item>
		<item>
		<title>SVN Commits and new Sugar…</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/198294142/</link>
		<comments>http://www.datejs.com/2007/12/10/svn-commits-and-new-sugar/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 23:06:43 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2007/12/10/svn-commits-and-new-sugar/</guid>
		<description><![CDATA[Since the Alpha 1 launch a couple weeks ago we&#8217;ve been steadily hammering away at Datejs enhancements, writing tests and pushing towards our goal of a solid Beta 1 release for early January 2008.
The launch went well and community feedback has been steady and very much appreciated. As defects are discovered we&#8217;re doing our best [...]]]></description>
			<content:encoded><![CDATA[<p>Since the <a href="http://www.datejs.com/2007/12/04/ajaxian-24-hours/">Alpha 1 launch</a> a couple weeks ago we&#8217;ve been steadily hammering away at Datejs enhancements, writing <a href="http://www.datejs.com/test/">tests</a> and pushing towards our goal of a solid Beta 1 release for early January 2008.</p>
<p>The launch went well and community feedback has been steady and very much appreciated. As defects are discovered we&#8217;re doing our best to fix immediately and commit the new code to <a href="http://www.datejs.com/svn/">SVN</a>.</p>
<p><a href="http://groups.google.com/group/datejs-commits/topics"><img src='http://www.datejs.com/wp-content/uploads/2007/12/svn_commits.gif' alt='Datejs SVN Commit messages' style="float: right; padding-left: 10px;" /></a>If you&#8217;re interested in following along as we commit code to the source repository, you might want to subscribe to the <a href="http://groups.google.com/group/datejs-commits/topics">Datejs-commits Discussion Group</a>. The Datejs-commits Group automagically catches all the SVN commit log messages and creates a <a href="http://groups.google.com/group/datejs-commits/feeds">feed</a> which is then easily consumed into your favourite news reader. We&#8217;re doing our best to always ensure the SVN log notes give plenty of detail regarding all new code and/or revisions.</p>
<h3>A spoonful of SugarPak</h3>
<p>For developers partial to the <a href="http://www.datejs.com/test/rememberthemilk/index.html">RememberTheMilk.com</a> date input options we added the following API functions and abbreviations.</p>
<div class="codesnip-container" >
<div class="codesnip">Date.<span class="me1">tod</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// Date.today()</span><br />
Date.<span class="me1">tomorrow</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
Date.<span class="me1">tom</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
Date.<span class="me1">yesterday</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
Date.<span class="me1">yes</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</div>
<p>Added a new <code>.at()</code> function which accepts a Time string or Time config object.</p>
<div class="codesnip-container" >
<div class="codesnip">Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">at</span><span class="br0">&#40;</span><span class="st0">&#8220;6:15 PM&#8221;</span><span class="br0">&#41;</span>;<br />
Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">at</span><span class="br0">&#40;</span><span class="br0">&#123;</span>hour: <span class="nu0">18</span>, minute: <span class="nu0">15</span><span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</div>
<p>Added <code>.next()</code> and <code>.last()</code> as static functions to the Date object, so you no longer need to instantiate a Date object first before calling <code>.next()</code> or <code>.last()</code>. </p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">// Existing</span><br />
Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">friday</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">last</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">march</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// New</span><br />
<span class="co1">// The above code still works,</span><br />
<span class="co1">// but if you want to be relative to &#8216;today&#8217;, </span><br />
<span class="co1">// the following code is tighter.</span><br />
Date.<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">friday</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
Date.<span class="me1">last</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">march</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</div>
<p>Date logic actually gets fun to write when you start combining the functions to build amazingly readable Date expressions.</p>
<div class="codesnip-container" >
<div class="codesnip">Date.<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">friday</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">at</span><span class="br0">&#40;</span><span class="st0">&#8220;6:15 PM&#8221;</span><span class="br0">&#41;</span>;</div>
</div>
<p><strong>[Use Case]</strong> Schedule a reminder to be sent a week before the start of the next month at 9 in the morning.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>.<span class="me1">week</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">before</span><span class="br0">&#40;</span>Date.<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">month</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">at</span><span class="br0">&#40;</span><span class="st0">&#8220;9:00 am&#8221;</span><span class="br0">&#41;</span>;</div>
</div>
<p>Hope this helps.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=zNV9XV"><img src="http://feeds.feedburner.com/~a/datejs?i=zNV9XV" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2007/12/10/svn-commits-and-new-sugar/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2007/12/10/svn-commits-and-new-sugar/</feedburner:origLink></item>
		<item>
		<title>Ajaxian + 24 Hours</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/195237097/</link>
		<comments>http://www.datejs.com/2007/12/04/ajaxian-24-hours/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 00:02:44 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2007/12/04/ajaxian-24-hours/</guid>
		<description><![CDATA[Well, it certainly was an interesting finish to November. 
Late afternoon on Date.parse("Tuesday, November 28, 2007") Ajaxian published a blog post about the Datejs library and within the subsequent 24 hours, 30,000 deadly Datejs ninjas began their training.

I thought people might be interested in seeing some of the community feedback and hard traffic stats we [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it certainly was an interesting finish to November. </p>
<p>Late afternoon on <code>Date.parse("Tuesday, November 28, 2007")</code> <a href="http://www.ajaxian.com/">Ajaxian</a> published a blog post about the Datejs library and within the subsequent 24 hours, 30,000 deadly Datejs ninjas began their training.</p>
<p><img src='http://www.datejs.com/wp-content/uploads/2007/12/30000downloads.gif' alt='30000 Downloads' /></p>
<p>I thought people might be interested in seeing some of the community feedback and hard traffic stats we received during that first 24 hours.</p>
<p><img src='http://www.datejs.com/wp-content/uploads/2007/12/ajaxian_logo.gif' alt='Ajaxian' style="float:left; padding-right: 10px;" />Let&#8217;s kick it off where it all started &#8212; the &#8220;<a href="http://www.ajaxian.com/archives/mad-cool-date-library">Mad Cool Date Library</a>&#8221; Ajaxian blog post by <a href="http://www.reybango.com/">Rey Bango</a>.</p>
<blockquote><p>&#8220;Holy cow!!! All I have to say is <strong><em>wow</em></strong>. This is a <strong>VERY</strong> cool date library and definitely unique. I’ve not seen anything like this.&#8221;</p></blockquote>
<p>When I first saw the post title I read it as &#8220;<strong>Mad Cow</strong> Date Library&#8221; and thought, ooh&#8230; that sounds interesting. Totally did not make the connection to Datejs at first. Yes, I&#8217;m a <a href="http://en.wikipedia.org/wiki/Hoser">hoser</a>.</p>
<p>The comments section lit up instantly with opinions and feedback.</p>
<p>&nbsp;</p>
<p><img src='http://www.datejs.com/wp-content/uploads/2007/12/mashable_logo.gif' alt='Mashable' style="float:left; padding-right: 10px;" />Around that same time the post &#8220;<a href="http://mashable.com/2007/11/27/datejs-a-truly-slick-date-script/">Datejs: A Truly Slick Date Script</a>&#8221; by Mark &#8216;Rizzn&#8217; Hopkins at <a href="http://www.mashable.com/">Mashable</a> came online.</p>
<blockquote><p>&#8220;It isn’t often when I come across a JavaScript so cool that I feel I must blog about it. In fact, I don’t think I’ve ever come across such a JavaScript before today. Datejs earns this elusive distinction today because it&#8217;s just so darn good at what it does.&#8221;</p></blockquote>
<blockquote><p>&#8220;It is everything I&#8217;ve ever wanted in a form date validation tool, but didn&#8217;t have the patience to program. Datejs is fast, too. I’m stuck using one of my slowest machines today, and there is no noticeable delay between the typing and the translation of the date.&#8221;</p></blockquote>
<p>&nbsp;</p>
<p><img src='http://www.datejs.com/wp-content/uploads/2007/12/wired_logo.gif' alt='Wired' style="float: left; padding-right: 10px;" />A similar post by Scott Gilbertson at Wired Monkeybites &#8220;<a href="http://blog.wired.com/monkeybites/2007/11/sleek-javascrip.html">Sleek JavaScript Library Solves Your Dating Woes</a>&#8220;.</p>
<blockquote><p>&#8220;It&#8217;s not often that we run across a JavaScript library that&#8217;s cool enough to warrant a post, but Datejs really is that cool.&#8221;</p></blockquote>
<p>&nbsp;</p>
<p><a href="http://dev.zeraweb.com/">Dan Yoder</a> (who is also the co-author of Datejs) posted an excellent  introduction to the library and a few thoughts on where we&#8217;re heading. <a href="http://dev.zeraweb.com/introducing-datejs">Check it out</a>.</p>
<blockquote><p>&#8220;&#8230;JavaScript was in dire need of a comprehensive and straightforward Date library. And now it has one.&#8221;</p></blockquote>
<p>A few others from the Blogosphere&#8230;<br />
<a href="http://marcgrabanski.com/article/90/DateJS-JavaScript-Library">Marc Grabanski</a><br />
<a href="http://www.webappers.com/2007/12/01/datejs-open-source-javascript-date-library/">WebAppers</a><br />
<a href="http://ajax.phpmagazine.net/2007/11/datejs_opensource_javascript_d.html">AJAX Magazine</a><br />
<a href="http://blackbeltcoder.net/2007/11/19/datejs-has-been-released/">Black Belt Coder</a><br />
<a href="http://dylanschiemann.com/2007/11/28/datejs/">Dylan Schiemann</a><br />
<a href="http://nform.ca/blog/2007/12/datejs-designing-for-developer">nForm</a><br />
<a href="http://www.thehomeofjon.net/blog/title/killer-javascript-date-library.html">The Home of Jon</a></p>
<p>I&#8217;m doing a little cherry picking here, but honestly there were very few negative comments. I was expecting more. Not really sure why I thought that, just did. </p>
<p>In general people were being incredibly helpful pointing out parsing failures &#8212; many of which were edge case bugs we had not been testing for.</p>
<p>Most were fixed within a few hours. </p>
<p>There&#8217;s obviously still a lot of work to do with date expressions, but I think we&#8217;re off to a good start and broader support will come over time. To get the full scope of what the Parser will parse, please browse through the Datejs <a href="http://www.datejs.com/test/">Test Suite</a>.</p>
<h2>Stats from Google Analytics</h2>
<h3>Total Hits</h3>
<p><img src='http://www.datejs.com/wp-content/uploads/2007/12/day1_analytics_overview1.gif' alt='Visitor Overview' /></p>
<p>We watched the hit and download count increase pretty steadily throughout the day, but quickly noticed a growing disconnect between the number of hits on the datejs.com website and the total downloads. At the end of the first 24 hours, total website traffic had just passed 6,500 hits, with about 1/2 of that coming directly from Ajaxian. We were expecting a lot more traffic to register from Ajaxian, especially given the 30,000 downloads. </p>
<p>So, the question was, where were all the downloads coming from? </p>
<p>It took some head scratching, but eventually we went back to the Ajaxian post and noticed the very last link, linked directly to the GoogleCode download page. See</p>
<p><img src='http://www.datejs.com/wp-content/uploads/2007/12/ajaxian_last_link3.gif' alt='Ajaxian - link to download' /></p>
<p>Unfortunately Analytics does not record stats from the GoogleCode file download pages. That kinda sucks, although the total download count does give us a pretty good idea that the vast majority of Ajaxian readers (I guess approx 20,000) must have clicked the very last link in the post and were shot off directly to the GoogleCode download page, bypassing the datejs.com website. That&#8217;s pretty interesting and unfortunate because most would have missed the <strong>&#8220;Mad Skillz&#8221;</strong> widget on the <a href="http://www.datejs.com/">home page</a>. Oh well.</p>
<h3>Visitors by Browser</h3>
<p>Huge FireFox usage. Not surprising I guess, given the crowd.</p>
<p><img src='http://www.datejs.com/wp-content/uploads/2007/12/day1_analytics_browsers.gif' alt='Visitors by Browser' /></p>
<h3>Visitors by Operating System</h3>
<p>Check out the 9 iPhone and 2 iPod hits!</p>
<p><img src='http://www.datejs.com/wp-content/uploads/2007/12/day1_analytics_operating_systems.gif' alt='Visitors by Operating System' /></p>
<h3>Visitors by Country</h3>
<p><img src='http://www.datejs.com/wp-content/uploads/2007/12/day1_analytics_map.gif' alt='Visitors by Country' /></p>
<p>&nbsp;</p>
<p>After all was said and done I think it went well and the library is better because of the feedback. Keep it coming.</p>
<p>Please feel free to <a href="http://www.datejs.com/contact/">contact us</a> or post to the <a href="http://www.datejs.com/forums/">forums</a> if you have any questions or comments and we&#8217;ll do our best to help out.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=iAZGTK"><img src="http://feeds.feedburner.com/~a/datejs?i=iAZGTK" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2007/12/04/ajaxian-24-hours/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2007/12/04/ajaxian-24-hours/</feedburner:origLink></item>
		<item>
		<title>Getting Started with Datejs…</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/191274566/</link>
		<comments>http://www.datejs.com/2007/11/27/getting-started-with-datejs/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 12:09:00 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2007/11/27/getting-started-with-datejs/</guid>
		<description><![CDATA[Welcome grasshopper. Let us begin.
Step #1 - Pick your weapon
In order to move safely through the shadowy world of the JavaScript Date Class you must add the date.js file to your arsenal of tools. 
Example

&#60;script type=&#8220;text/javascript&#8221; src=&#8220;date.js&#8221;&#62;&#60;/script&#62;

You can download the latest release from datejs.com/download/ or connect directly to the SVN source repository via datejs.com/svn/.
The date.js [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome <em>grasshopper</em>. Let us begin.</p>
<h3>Step #1 - Pick your weapon</h3>
<p>In order to move safely through the shadowy world of the JavaScript Date Class you must add the <code>date.js</code> file to your arsenal of tools. </p>
<h4>Example</h4>
<div class="codesnip-container" >
<div class="codesnip">&lt;script type=<span class="st0">&#8220;text/javascript&#8221;</span> src=<span class="st0">&#8220;date.js&#8221;</span>&gt;&lt;/script&gt;</div>
</div>
<p>You can download the latest release from <a href="http://www.datejs.com/download/">datejs.com/download/</a> or connect directly to the SVN source repository via <a href="http://www.datejs.com/svn/">datejs.com/svn/</a>.</p>
<p>The <code>date.js</code> file can be found within the <code>/build/</code> folder. </p>
<p>Datejs has traveled to many lands and returns with knowledge of over 150 individual Cultures. Supporting your language of choice is simple, just swap out the <code>date.js</code> file for another culture-specific file.</p>
<h4>Example</h4>
<div class="codesnip-container" >
<div class="codesnip">en-US <span class="br0">&#91;</span>English <span class="br0">&#40;</span>United States<span class="br0">&#41;</span><span class="br0">&#93;</span><br />
&lt;script type=<span class="st0">&#8220;text/javascript&#8221;</span> src=<span class="st0">&#8220;date.js&#8221;</span>&gt;&lt;/script&gt;</p>
<p>en-US <span class="br0">&#91;</span>English <span class="br0">&#40;</span>United States<span class="br0">&#41;</span><span class="br0">&#93;</span><br />
&lt;script type=<span class="st0">&#8220;text/javascript&#8221;</span> src=<span class="st0">&#8220;date-en-US.js&#8221;</span>&gt;&lt;/script&gt;</p>
<p>de-DE <span class="br0">&#91;</span>German <span class="br0">&#40;</span>Germany<span class="br0">&#41;</span><span class="br0">&#93;</span><br />
&lt;script type=<span class="st0">&#8220;text/javascript&#8221;</span> src=<span class="st0">&#8220;date-de-DE.js&#8221;</span>&gt;&lt;/script&gt;</p>
<p>fr-FR <span class="br0">&#91;</span>French <span class="br0">&#40;</span>France<span class="br0">&#41;</span><span class="br0">&#93;</span><br />
&lt;script type=<span class="st0">&#8220;text/javascript&#8221;</span> src=<span class="st0">&#8220;date-fr-FR.js&#8221;</span>&gt;&lt;/script&gt;</div>
</div>
<p>All 150+ CultureInfo files have been pre-compiled and are available within the same <code>/build/</code> folder as <code>date.js</code>. Each culture file includes translations for many of the strings used in the Datejs library. Some strings have not been translated, although will be filled in over time as the community contributes.</p>
<h3>Step #2 - Start your training</h3>
<p>The Datejs library includes many helpful functions for easing the pain of developing with Dates and Times in JavaScript. Once the <code>date.js</code> file has been included into your page you can begin some serious training.</p>
<p>If you have not already done so, we highly recommend installing <a href="http://www.getfirebug.com/">FireBug</a> for <a href="http://www.getfirefox.com/">FireFox</a>. Among many things, Firebug allows you to execute custom JavaScript code directly in the browser without having to edit your source page &#8212; kind of like a command-line for JavaScript. Get it now. The Ninja waits.</p>
<h3>Let&#8217;s Get Started</h3>
<p>Before diving deep into the library, let&#8217;s first limber up with some stretching. Exploring the natural language syntax is a good place to start.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">// Get today&#8217;s date</span><br />
Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// Add 5 days to today</span><br />
Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">add</span><span class="br0">&#40;</span><span class="nu0">5</span><span class="br0">&#41;</span>.<span class="me1">days</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// Get Friday of this week</span><br />
Date.<span class="me1">friday</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// Get March of this year</span><br />
Date.<span class="me1">march</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// Is today Friday?</span><br />
Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="kw1">is</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">friday</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;&nbsp; <span class="co1">// true|false</span></p>
<p><span class="co1">// What day is it?</span><br />
Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getDayName</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</div>
<p>Everything ok? A little out of breath? Soooo sorry.</p>
<p>Now, some Date <em>Assassin</em> exercises.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">// Get the first Monday of the year</span><br />
Date.<span class="me1">january</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">first</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">monday</span><span class="br0">&#40;</span><span class="br0">&#41;</span></p>
<p><span class="co1">// Get the last Friday of the year</span><br />
Date.<span class="me1">dec</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">final</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">fri</span><span class="br0">&#40;</span><span class="br0">&#41;</span></p>
<p><span class="co1">// Set a date to the 15th of the current month at 4:30 PM,</span><br />
<span class="co1">// then add 90 days and make sure that date is a weekday,</span><br />
<span class="co1">// else move to the next weekday.</span><br />
<span class="kw2">var</span> d1 = Date.<span class="me1">today</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; .<span class="me1">set</span><span class="br0">&#40;</span><span class="br0">&#123;</span> day: <span class="nu0">15</span>, hour: <span class="nu0">16</span>, minute: <span class="nu0">30</span> <span class="br0">&#125;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; .<span class="me1">add</span><span class="br0">&#40;</span><span class="br0">&#123;</span> days: <span class="nu0">90</span> <span class="br0">&#125;</span><span class="br0">&#41;</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span>!d1.<span class="me1">isWeekday</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; d1.<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">monday</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p>How about letting your users enter a few dates? Say into an <code>&lt;input&gt;</code> field or date picker? Included with the Datejs library is a powerful replacement for the native JavaScript Date parser.</p>
<p>The following examples all start with a String value that we convert into a Date object.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">// Lets start simple. &quot;Today&quot;</span><br />
Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;today&#8217;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// How about tomorrow?</span><br />
Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;tomorrow&#8217;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// July 8?</span><br />
Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;July 8&#8242;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// With a year?</span><br />
Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;July 8th, 2007&#8242;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// And time?</span><br />
Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;July 8th, 2007, 10:30 PM&#8217;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// Get the date, move to Monday (if not already Monday),</span><br />
<span class="co1">// then alert the date to the user in a different format.</span><br />
<span class="kw2">var</span> d1 = Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;8-Jul-2007&#8242;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">if</span> <span class="br0">&#40;</span>!d1.<span class="kw1">is</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">monday</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; d1.<span class="me1">last</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">monday</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw3">alert</span><span class="br0">&#40;</span>d1.<span class="me1">toString</span><span class="br0">&#40;</span><span class="st0">&#8216;dddd, MMMM d, yyyy&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</div>
<p>The library also includes some Number fun. In order to execute functions directly on JavaScript Number objects, the number must be wrapped in parentheses. This is a requirement of JavaScript. If the number is declared first, the parentheses are not required.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">// Get a date 3 days from now</span><br />
<span class="br0">&#40;</span><span class="nu0">3</span><span class="br0">&#41;</span>.<span class="me1">days</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">fromNow</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// 6 month ago</span><br />
<span class="br0">&#40;</span><span class="nu0">6</span><span class="br0">&#41;</span>.<span class="me1">months</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">ago</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// 12 weeks from now</span><br />
<span class="kw2">var</span> n = <span class="nu0">12</span>;<br />
n.<span class="me1">weeks</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">fromNow</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// Get a date 30 days after a user supplied date</span><br />
<span class="kw2">var</span> d1 = Date.<span class="me1">parse</span><span class="br0">&#40;</span><span class="st0">&#8216;07.15.2007&#8242;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> d2 = <span class="br0">&#40;</span><span class="nu0">30</span><span class="br0">&#41;</span>.<span class="me1">days</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">after</span><span class="br0">&#40;</span>d1<span class="br0">&#41;</span>;</div>
</div>
<h3>Step #3 - Refine your skillz</h3>
<p>You are nearing a state of Date Ninja-ness, but more experience is required. </p>
<p>Please be sure to check out the following list of resources for further training.</p>
<ul>
<li>Datejs at <a href="http://www.datejs.com/googlecode/">GoogleCode</a></li>
<li><a href="http://www.datejs.com/documentation/">Documentation</a></li>
<li><a href="http://www.datejs.com/forums/">Forums</a></li>
<li><a href="http://www.datejs.com/download/">Downloads</a></li>
<li><a href="http://www.datejs.com/svn/">SVN</a></li>
</ul>
<p>The Datejs Library also includes good size <a href="http://www.datejs.com/test/">Test Suite</a>, which is worth browsing to get a idea of what&#8217;s possible. </p>
<p>Hope this helps.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=TTRBVh"><img src="http://feeds.feedburner.com/~a/datejs?i=TTRBVh" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2007/11/27/getting-started-with-datejs/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2007/11/27/getting-started-with-datejs/</feedburner:origLink></item>
		<item>
		<title>Datejs is here…</title>
		<link>http://feeds.feedburner.com/~r/datejs/~3/187288546/</link>
		<comments>http://www.datejs.com/2007/11/19/datejs-is-here/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 18:31:14 +0000</pubDate>
		<dc:creator>geoffrey.mcgill</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.datejs.com/2007/11/19/datejs-is-here/</guid>
		<description><![CDATA[We’re very pleased to announce that Datejs has arrived. KaBoom!
So, what is Datejs?
Datejs is an open-source JavaScript Date library.
For a long time, dates have been ignored in the world of JavaScript. Datejs is now the ultimate JavaScript warrior for not only parsing, but formatting and processing as well.
Datejs is comprehensive, yet simple, stealthy and fast.
Date [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.datejs.com/wp-content/uploads/2007/11/datejs_preview.jpg' alt='datejs_preview.jpg' style="float:right;" />We’re very pleased to announce that Datejs has arrived. <strong>KaBoom!</strong></p>
<p>So, what is Datejs?</p>
<p>Datejs is an open-source JavaScript Date library.</p>
<p>For a long time, dates have been ignored in the world of JavaScript. Datejs is now the ultimate JavaScript warrior for not only parsing, but formatting and processing as well.</p>
<p>Datejs is comprehensive, yet simple, stealthy and fast.</p>
<p>Date objects need no longer be feared, for when they least expect it, Datejs shall silently leap from the shadows of the web and drive a katana of logic deep into the their heats, rendering them instantly and thoroughly, parsed.</p>
<p><a href="/download/">Download</a> the library to get started.</p>

<p><a href="http://feeds.feedburner.com/~a/datejs?a=Cj1fdp"><img src="http://feeds.feedburner.com/~a/datejs?i=Cj1fdp" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.datejs.com/2007/11/19/datejs-is-here/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.datejs.com/2007/11/19/datejs-is-here/</feedburner:origLink></item>
	</channel>
</rss>
