<?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: Date Formatting with YUI &#8211; Part IV</title>
	<atom:link href="http://www.yuiblog.com/blog/index.php/2009/07/06/date-formatting-pt4/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yuiblog.com/blog/2009/07/06/date-formatting-pt4/</link>
	<description>The official blog of the YUI Project.</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:46:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Arnaud Meuret</title>
		<link>http://www.yuiblog.com/blog/2009/07/06/date-formatting-pt4/comment-page-1/#comment-582853</link>
		<dc:creator>Arnaud Meuret</dc:creator>
		<pubDate>Thu, 23 Jul 2009 11:36:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=392#comment-582853</guid>
		<description>Julien Lecomte is absolutely wrong, the names of the days as well as the months&#039; names must not be capitalized. Any decent french grammar (e.g. &quot;Le Bescherelle&quot;) can be looked up on that in 20s. The only special case is about anniversary dates or generally important historical dates such as &quot;Le 11 Novembre&quot; or &quot;Le 14 Juillet&quot;. Those acquire a special status and cease to be treated as common names.

The YUI Date utility is a blessing, thnaks for the awesome works... as usual !</description>
		<content:encoded><![CDATA[<p>Julien Lecomte is absolutely wrong, the names of the days as well as the months&#8217; names must not be capitalized. Any decent french grammar (e.g. &#8220;Le Bescherelle&#8221;) can be looked up on that in 20s. The only special case is about anniversary dates or generally important historical dates such as &#8220;Le 11 Novembre&#8221; or &#8220;Le 14 Juillet&#8221;. Those acquire a special status and cease to be treated as common names.</p>
<p>The YUI Date utility is a blessing, thnaks for the awesome works&#8230; as usual !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip Tellis</title>
		<link>http://www.yuiblog.com/blog/2009/07/06/date-formatting-pt4/comment-page-1/#comment-582487</link>
		<dc:creator>Philip Tellis</dc:creator>
		<pubDate>Thu, 09 Jul 2009 18:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=392#comment-582487</guid>
		<description>@Janos, the syntax you&#039;re using seems to be based on the YUI3 version of the date utility and it looks like you&#039;re trying to add a new format specifier to the locale.

At this point of time though, only single character format specifiers are supported, so this may not work the way you expect it to.  That said, I haven&#039;t verified that it won&#039;t work.

We&#039;ll be adding templates in a future version, mainly to make it easier to generate an ISO8601, or RFC2822, or unix date command style dates.  When this support has been added, it should be possible to do what you want.  I have no timeline on when this will happen though.</description>
		<content:encoded><![CDATA[<p>@Janos, the syntax you&#8217;re using seems to be based on the YUI3 version of the date utility and it looks like you&#8217;re trying to add a new format specifier to the locale.</p>
<p>At this point of time though, only single character format specifiers are supported, so this may not work the way you expect it to.  That said, I haven&#8217;t verified that it won&#8217;t work.</p>
<p>We&#8217;ll be adding templates in a future version, mainly to make it easier to generate an ISO8601, or RFC2822, or unix date command style dates.  When this support has been added, it should be possible to do what you want.  I have no timeline on when this will happen though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tjp</title>
		<link>http://www.yuiblog.com/blog/2009/07/06/date-formatting-pt4/comment-page-1/#comment-582485</link>
		<dc:creator>tjp</dc:creator>
		<pubDate>Thu, 09 Jul 2009 16:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=392#comment-582485</guid>
		<description>I&#039;m wondering if there&#039;s a preferred way of augmenting the locale - ie. if I want to have a localized time format - 24 hours by default, 12 hours for en-GB. Not sure this is the best way to do:

  Y.each(Y.DataType.Date.Locale, function(loc) {
    loc[&#039;TS&#039;] = &#039;%H:%M&#039;;
  });
  Y.DataType.Date.Locale[&quot;en-GB&quot;][&quot;TS&quot;]=&#039;%I:%M%p&#039;;</description>
		<content:encoded><![CDATA[<p>I&#8217;m wondering if there&#8217;s a preferred way of augmenting the locale &#8211; ie. if I want to have a localized time format &#8211; 24 hours by default, 12 hours for en-GB. Not sure this is the best way to do:</p>
<p>  Y.each(Y.DataType.Date.Locale, function(loc) {<br />
    loc['TS'] = &#8216;%H:%M&#8217;;<br />
  });<br />
  Y.DataType.Date.Locale["en-GB"]["TS"]=&#8217;%I:%M%p&#8217;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip Tellis</title>
		<link>http://www.yuiblog.com/blog/2009/07/06/date-formatting-pt4/comment-page-1/#comment-582420</link>
		<dc:creator>Philip Tellis</dc:creator>
		<pubDate>Wed, 08 Jul 2009 00:07:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=392#comment-582420</guid>
		<description>@Julien, you&#039;re probably right, but I&#039;ve only been able to find documentation regarding abbreviated short forms for French months.  Until I can find an authoritative source , I&#039;m sticking with what the system locale information on unix tells me.

@Andrea, thanks for the addition.

@Nate: good point.  We actually don&#039;t recommend using the Accept-Language header as the sole method for detecting language for a few reasons.  Some people have this header set incorrectly, and there are also cases when one is travelling in a foreign country, using an internet cafe computer.  In both cases, the Accept-Language header may not be what the user really wants.  It&#039;s better to give the user the choice up front.  You can also just restrict the choice to the list that you support.

There&#039;s also the case where you may not actually support anything that the Accept-Language requests.  In that case, you have a choice between giving the user the option, or returning a 406 Not Acceptable header.

That said, the locale string we use is not very strict, so someone could potentially create one for klingon, or elmer fudd.</description>
		<content:encoded><![CDATA[<p>@Julien, you&#8217;re probably right, but I&#8217;ve only been able to find documentation regarding abbreviated short forms for French months.  Until I can find an authoritative source , I&#8217;m sticking with what the system locale information on unix tells me.</p>
<p>@Andrea, thanks for the addition.</p>
<p>@Nate: good point.  We actually don&#8217;t recommend using the Accept-Language header as the sole method for detecting language for a few reasons.  Some people have this header set incorrectly, and there are also cases when one is travelling in a foreign country, using an internet cafe computer.  In both cases, the Accept-Language header may not be what the user really wants.  It&#8217;s better to give the user the choice up front.  You can also just restrict the choice to the list that you support.</p>
<p>There&#8217;s also the case where you may not actually support anything that the Accept-Language requests.  In that case, you have a choice between giving the user the option, or returning a 406 Not Acceptable header.</p>
<p>That said, the locale string we use is not very strict, so someone could potentially create one for klingon, or elmer fudd.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate</title>
		<link>http://www.yuiblog.com/blog/2009/07/06/date-formatting-pt4/comment-page-1/#comment-582410</link>
		<dc:creator>Nate</dc:creator>
		<pubDate>Tue, 07 Jul 2009 18:21:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=392#comment-582410</guid>
		<description>Great info! Note the locale is case-sensitive. This might affect you if you are using the HTTP Accept-Language header to determine which language to show. Most browsers send an all–lower case Accept-Language header (“en-gb”), but YAHOO.util.DateLocale would expect “en-GB”.</description>
		<content:encoded><![CDATA[<p>Great info! Note the locale is case-sensitive. This might affect you if you are using the HTTP Accept-Language header to determine which language to show. Most browsers send an all–lower case Accept-Language header (“en-gb”), but YAHOO.util.DateLocale would expect “en-GB”.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Giammarchi</title>
		<link>http://www.yuiblog.com/blog/2009/07/06/date-formatting-pt4/comment-page-1/#comment-582389</link>
		<dc:creator>Andrea Giammarchi</dc:creator>
		<pubDate>Tue, 07 Jul 2009 08:02:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=392#comment-582389</guid>
		<description>Good stuff as usual. This should be &quot;it&quot; file
&lt;code&gt;
YAHOO.util.DateLocale[&#039;it&#039;] = YAHOO.lang.merge(YAHOO.util.DateLocale, {
	a: [&#039;dom&#039;, &#039;lun&#039;, &#039;mar&#039;, &#039;mer&#039;, &#039;gio&#039;, &#039;ven&#039;, &#039;sab&#039;],
	A: [&#039;domenica&#039;, &#039;lunedi&#039;, &#039;martedi&#039;, &#039;mercoledi&#039;, &#039;giovedi&#039;, &#039;venerdi&#039;, &#039;sabato&#039;],
	b: [&#039;gen&#039;, &#039;feb&#039;, &#039;mar&#039;, &#039;apr&#039;, &#039;mag&#039;, &#039;giu&#039;, &#039;lug&#039;, &#039;ago&#039;, &#039;set&#039;, &#039;ott&#039;, &#039;nov&#039;, &#039;dic&#039;],
	B: [&#039;gennaio&#039;, &#039;febbraio&#039;, &#039;marzo&#039;, &#039;aprile&#039;, &#039;maggio&#039;, &#039;giugno&#039;, &#039;luglio&#039;, &#039;agosto&#039;, &#039;settembre&#039;, &#039;ottobre&#039;, &#039;novembre&#039;, &#039;dicembre&#039;],
    x: &#039;%d/%m/%Y&#039;,
	X: &#039;%T&#039;
});

YAHOO.util.DateLocale[&#039;it-IT&#039;] = YAHOO.lang.merge(YAHOO.util.DateLocale[&#039;it&#039;], {
});
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Good stuff as usual. This should be &#8220;it&#8221; file<br />
<code><br />
YAHOO.util.DateLocale['it'] = YAHOO.lang.merge(YAHOO.util.DateLocale, {<br />
	a: ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'],<br />
	A: ['domenica', 'lunedi', 'martedi', 'mercoledi', 'giovedi', 'venerdi', 'sabato'],<br />
	b: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'],<br />
	B: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'],<br />
    x: '%d/%m/%Y',<br />
	X: '%T'<br />
});</p>
<p>YAHOO.util.DateLocale['it-IT'] = YAHOO.lang.merge(YAHOO.util.DateLocale['it'], {<br />
});<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julien Lecomte</title>
		<link>http://www.yuiblog.com/blog/2009/07/06/date-formatting-pt4/comment-page-1/#comment-582380</link>
		<dc:creator>Julien Lecomte</dc:creator>
		<pubDate>Tue, 07 Jul 2009 04:46:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=392#comment-582380</guid>
		<description>All those French words should be capitalized ;-) Good article, great info, Thanks Philip!</description>
		<content:encoded><![CDATA[<p>All those French words should be capitalized ;-) Good article, great info, Thanks Philip!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

