<?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"
	>
<channel>
	<title>Comments on: Yet Another Pretty Date JavaScript</title>
	<atom:link href="http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/</link>
	<description></description>
	<pubDate>Thu, 21 Aug 2008 10:23:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: unwiredbrain</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-820</link>
		<dc:creator>unwiredbrain</dc:creator>
		<pubDate>Sun, 29 Jun 2008 03:21:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-820</guid>
		<description>OK. Wait a sec. My previous comment clearly shows that I did not understand anything about your script. I apologize for that.

But...

I (think I) found a glitch -- from now on consider all the dates &#38; everything treated as UTC: if you set a date to exactly now (where "now" is the instant where the page loads) the script returns a "2 Hours" -- I mean: future!

Is to be said that I live in a country where right now the time zone is CEST that is GMT plus two hours (see Wikipedia for more), but, as you can easily imagine, in other countries this could vary: zero, one or two, like me, or even more.

Now: all your script runs using UTC (which is good), but at line 34 you add the current local time zone offset, which is wrong in my opinion.

I think that this should be fixed, but I look forward to your opinion.

Anyway, I still think that you should never touch a future date, and I still think that by removing the token you'll get a more compact, readable and elegant code.

PS: just FYI, here's my test case: http://phpfi.com/327787

Leaving the script vanilla, I get the glitch; removing the time zone offset I get the correct behavior.

Also, you can test this by adding some minutes: just modify the 'difference' variable in the HTML document.

I hope the whole thing is clearer now.

Have a nice day.</description>
		<content:encoded><![CDATA[<p>OK. Wait a sec. My previous comment clearly shows that I did not understand anything about your script. I apologize for that.</p>
<p>But&#8230;</p>
<p>I (think I) found a glitch &#8212; from now on consider all the dates &amp; everything treated as UTC: if you set a date to exactly now (where &#8220;now&#8221; is the instant where the page loads) the script returns a &#8220;2 Hours&#8221; &#8212; I mean: future!</p>
<p>Is to be said that I live in a country where right now the time zone is CEST that is GMT plus two hours (see Wikipedia for more), but, as you can easily imagine, in other countries this could vary: zero, one or two, like me, or even more.</p>
<p>Now: all your script runs using UTC (which is good), but at line 34 you add the current local time zone offset, which is wrong in my opinion.</p>
<p>I think that this should be fixed, but I look forward to your opinion.</p>
<p>Anyway, I still think that you should never touch a future date, and I still think that by removing the token you&#8217;ll get a more compact, readable and elegant code.</p>
<p>PS: just FYI, here&#8217;s my test case: <a href="http://phpfi.com/327787" rel="nofollow">http://phpfi.com/327787</a></p>
<p>Leaving the script vanilla, I get the glitch; removing the time zone offset I get the correct behavior.</p>
<p>Also, you can test this by adding some minutes: just modify the &#8216;difference&#8217; variable in the HTML document.</p>
<p>I hope the whole thing is clearer now.</p>
<p>Have a nice day.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: unwiredbrain</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-819</link>
		<dc:creator>unwiredbrain</dc:creator>
		<pubDate>Sat, 28 Jun 2008 15:28:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-819</guid>
		<description>Very nice work.

But there's something I really don't get: if I'm using a future date (think about a dtstart / dtend duet, like hCalendar does), the script treats them as &lt;strong&gt;past&lt;/strong&gt; events!

If current year is 2008 and I'm planning some event for year 2009, the script says "1 Year Ago"! This is undoubtedly &lt;strong&gt;wrong&lt;/strong&gt;! And should be avoided, of course.

For me, the problem resides in the first if clause: seconds should not be modified; if seconds are less than zero, then the script should do nothing, returning null.

A null returning would be very comfortable, allowing control statements as John Resig did in his original scripts; in particular, would be comfortable because you would not soil the innerHTML.

Also, if you avoid the token, all the script will instantly get more suitable for l10n, making the code more clean and readable.</description>
		<content:encoded><![CDATA[<p>Very nice work.</p>
<p>But there&#8217;s something I really don&#8217;t get: if I&#8217;m using a future date (think about a dtstart / dtend duet, like hCalendar does), the script treats them as <strong>past</strong> events!</p>
<p>If current year is 2008 and I&#8217;m planning some event for year 2009, the script says &#8220;1 Year Ago&#8221;! This is undoubtedly <strong>wrong</strong>! And should be avoided, of course.</p>
<p>For me, the problem resides in the first if clause: seconds should not be modified; if seconds are less than zero, then the script should do nothing, returning null.</p>
<p>A null returning would be very comfortable, allowing control statements as John Resig did in his original scripts; in particular, would be comfortable because you would not soil the innerHTML.</p>
<p>Also, if you avoid the token, all the script will instantly get more suitable for l10n, making the code more clean and readable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hunka</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-810</link>
		<dc:creator>Hunka</dc:creator>
		<pubDate>Tue, 20 May 2008 13:30:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-810</guid>
		<description>it is really nice script.</description>
		<content:encoded><![CDATA[<p>it is really nice script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Sherman : Pretty Dates in JavaScript</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-764</link>
		<dc:creator>Gary Sherman : Pretty Dates in JavaScript</dc:creator>
		<pubDate>Mon, 05 May 2008 21:58:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-764</guid>
		<description>[...] Finally, Zach Letterman commented that he updated Dean's script, and posted a newer version. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Finally, Zach Letterman commented that he updated Dean&#8217;s script, and posted a newer version. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Sherman</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-763</link>
		<dc:creator>Gary Sherman</dc:creator>
		<pubDate>Mon, 05 May 2008 21:39:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-763</guid>
		<description>Zach,

Very nice!  This is exactly what I was looking for.
Thanks for sharing!</description>
		<content:encoded><![CDATA[<p>Zach,</p>
<p>Very nice!  This is exactly what I was looking for.<br />
Thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zachleat.com {web} &#187; ALARMd 2 Beta, with Google Calendar Integration</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-649</link>
		<dc:creator>zachleat.com {web} &#187; ALARMd 2 Beta, with Google Calendar Integration</dc:creator>
		<pubDate>Sun, 06 Apr 2008 07:32:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-649</guid>
		<description>[...] Human Readable Alarm Dates: Think &#8220;29 Minutes&#8221;, &#8220;1 Hour&#8221;, &#8220;2 Days Ago&#8221;. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Human Readable Alarm Dates: Think &#8220;29 Minutes&#8221;, &#8220;1 Hour&#8221;, &#8220;2 Days Ago&#8221;. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-607</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Fri, 28 Mar 2008 05:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-607</guid>
		<description>I appreciate the comment.  I hope someone else gets some good use out of it.</description>
		<content:encoded><![CDATA[<p>I appreciate the comment.  I hope someone else gets some good use out of it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jauder Ho</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-605</link>
		<dc:creator>Jauder Ho</dc:creator>
		<pubDate>Thu, 27 Mar 2008 07:33:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-605</guid>
		<description>Cool. This came in useful. Thanks for hacking this out.</description>
		<content:encoded><![CDATA[<p>Cool. This came in useful. Thanks for hacking this out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-601</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Tue, 25 Mar 2008 22:17:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-601</guid>
		<description>Thanks Dean.  I wouldn't have even noticed the problems had I not been trying to use the script for a project.

Open source moves solely due to impetus sometimes.</description>
		<content:encoded><![CDATA[<p>Thanks Dean.  I wouldn&#8217;t have even noticed the problems had I not been trying to use the script for a project.</p>
<p>Open source moves solely due to impetus sometimes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean Landolt</title>
		<link>http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-599</link>
		<dc:creator>Dean Landolt</dc:creator>
		<pubDate>Tue, 25 Mar 2008 14:39:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/#comment-599</guid>
		<description>Thanks for the fixes. I actually can't take credit for introducing those bugs (just completely missing them) -- I got that piece of code from a comment on Resig's original post which was actually the imputus for me to do the rewrite in the first place...

I like your code a &lt;em&gt;lot&lt;/em&gt; better than mine -- cleaner and easier to understand.</description>
		<content:encoded><![CDATA[<p>Thanks for the fixes. I actually can&#8217;t take credit for introducing those bugs (just completely missing them) &#8212; I got that piece of code from a comment on Resig&#8217;s original post which was actually the imputus for me to do the rewrite in the first place&#8230;</p>
<p>I like your code a <em>lot</em> better than mine &#8212; cleaner and easier to understand.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
