<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mike's Blog &#187; features</title>
	<atom:link href="http://blogs.nitobi.com/mike/index.php/category/features/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.nitobi.com/mike</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 15 Aug 2008 21:05:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Calendar Screencast!</title>
		<link>http://blogs.nitobi.com/mike/index.php/2008/07/17/calendar-screencast/</link>
		<comments>http://blogs.nitobi.com/mike/index.php/2008/07/17/calendar-screencast/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 16:02:28 +0000</pubDate>
		<dc:creator>mike.han</dc:creator>
				<category><![CDATA[calendar]]></category>
		<category><![CDATA[cui]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[q3]]></category>
		<category><![CDATA[screencast]]></category>

		<guid isPermaLink="false">http://blogs.nitobi.com/mike/?p=34</guid>
		<description><![CDATA[Forgot to include this screencast in my last post where I go through the new features.  What you can&#8217;t see in the video is all my nervous sweating, which is a good thing.
 
]]></description>
			<content:encoded><![CDATA[<p>Forgot to include this screencast in my last post where I go through the new features.  What you can&#8217;t see in the video is all my nervous sweating, which is a good thing.</p>
<p><embed src="http://blip.tv/play/xAzCziODxWs" type="application/x-shockwave-flash" width="480" height="360" allowscriptaccess="always" allowfullscreen="true"></embed> </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.nitobi.com/mike/index.php/2008/07/17/calendar-screencast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hot Date!</title>
		<link>http://blogs.nitobi.com/mike/index.php/2007/12/10/hot-date/</link>
		<comments>http://blogs.nitobi.com/mike/index.php/2007/12/10/hot-date/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 00:16:32 +0000</pubDate>
		<dc:creator>mike.han</dc:creator>
				<category><![CDATA[calendar]]></category>
		<category><![CDATA[cui]]></category>
		<category><![CDATA[features]]></category>

		<guid isPermaLink="false">http://blogs.nitobi.com/mike/index.php/2007/12/10/hot-date/</guid>
		<description><![CDATA[I was just going over the Calendar component when I found some useful functionality that was all tucked away, obscured from prying eyes.  But the time has come to unleash it upon you all!
1.  Formatting
There&#8217;s a method, DatePicker#getFormattedDate that will return the selected date as a string in the ubiquitous ISO8601 format (YYYY-MM-DD [...]]]></description>
			<content:encoded><![CDATA[<p>I was just going over the Calendar component when I found some useful functionality that was all tucked away, obscured from prying eyes.  But the time has come to unleash it upon you all!</p>
<p><strong>1.  Formatting</strong></p>
<p>There&#8217;s a method, <em>DatePicker#getFormattedDate</em> that will return the selected date as a string in the ubiquitous ISO8601 format (YYYY-MM-DD HH:MM:SS).</p>
<p>What&#8217;s better still, you can customize the format returned by getFormattedDate by using the formatter attribute on the Calendar declaration to specify a custom formatting function.</p>
<p><strong>The Function</strong><br />
Let&#8217;s say I want the Calendar to format dates like this:  MM/DD/YYYY.<br />
<code><br />
function customFormatter(date)<br />
{<br />
  if (nitobi.base.DateMath.invalid(date)) return "";<br />
  return nitobi.lang.padZeros(date.getMonth() + 1) + "/" + nitobi.lang.padZeros(date.getDate()) + "/" + date.getFullYear();<br />
};<br />
</code></p>
<p>A couple things to note here:</p>
<ul>
<li>First, it&#8217;s very important we ensure the date is valid.</li>
<li>Second, we use a helper method nitobi.lang.padZeros to ensure single digits get padded correctly (e.g. &#8220;1&#8243; will become &#8220;01&#8243;, but &#8220;10&#8243; will remain &#8220;10&#8243;).</li>
<li>Third, the argument is a Javascript Date object.</li>
</ul>
<p><strong>The Declaration</strong><br />
Next, we change our Calendar declaration and specify this custom function as the formatter:<br />
<code><br />
&lt;ntb:datepicker id="cal1" formatter="customFormatter"&gt;&lt;/ntb:datepicker&gt;<br />
</code></p>
<p>Now when we call #getFormattedDate we&#8217;ll get a string of the form MM/DD/YYYY.</p>
<p><strong>2.  Hidden Inputs</strong><br />
Another useful tidbit is the Calendar renders with a hidden input field that will store the formatted date which makes using it in a form pretty simple.  For a Calendar with an id of &#8220;calendar1&#8243;, the hidden input will have an id of &#8220;calendar1.value&#8221;.</p>
<p>Go figure!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.nitobi.com/mike/index.php/2007/12/10/hot-date/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

