<?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 formatting .NET style</title>
	<atom:link href="http://blog.mastykarz.nl/javascript-date-formatting-net-style/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mastykarz.nl/javascript-date-formatting-net-style/</link>
	<description>Innovation Matters &#124; SharePoint Server MVP &#124; ISSN 2210-9390</description>
	<lastBuildDate>Thu, 09 Feb 2012 05:22:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Mike Boulet</title>
		<link>http://blog.mastykarz.nl/javascript-date-formatting-net-style/comment-page-1/#comment-67355</link>
		<dc:creator>Mike Boulet</dc:creator>
		<pubDate>Thu, 20 Jan 2011 19:02:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/javascript-date-formatting-net-style/#comment-67355</guid>
		<description>Thanks for this example!

I had to make a minor change to it though. Sunday is the first day of the week in the US, so I had to update the days array in the code:

daysLong: [&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;],
daysShort: [&quot;Sun&quot;, &quot;Mon&quot;, &quot;Tue&quot;, &quot;Wed&quot;, &quot;Thu&quot;, &quot;Fri&quot;, &quot;Sat&quot;],


Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks for this example!</p>
<p>I had to make a minor change to it though. Sunday is the first day of the week in the US, so I had to update the days array in the code:</p>
<p>daysLong: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],<br />
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/javascript-date-formatting-net-style/comment-page-1/#comment-66265</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Thu, 06 Jan 2011 06:08:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/javascript-date-formatting-net-style/#comment-66265</guid>
		<description>@DBJ: the reason I used .NET instead of C# is because the same formatting pattern applies to other languages on the .NET platforms as well. I guess it&#039;s a semantical difference rather than the end of the world ;-) Thanks for the feedback.</description>
		<content:encoded><![CDATA[<p>@DBJ: the reason I used .NET instead of C# is because the same formatting pattern applies to other languages on the .NET platforms as well. I guess it&#039;s a semantical difference rather than the end of the world ;-) Thanks for the feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DBJ</title>
		<link>http://blog.mastykarz.nl/javascript-date-formatting-net-style/comment-page-1/#comment-66211</link>
		<dc:creator>DBJ</dc:creator>
		<pubDate>Wed, 05 Jan 2011 16:04:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/javascript-date-formatting-net-style/#comment-66211</guid>
		<description>I am really not your enemy, it is only that I think developers should be a bit more rigorous and scientific in their texts ;o)

Here what are you doing is comparing apples and pears. JavaScript is a language and .NET is an runtime environment. Which is on top of that also: language agnostic.

Comparing JavaScript to C# might have much more sense. 
But it seems to me, the most sensible approach would be not to mention .NET or C# at all and just present the solution.

There is a simple but very useful general format() which is also &quot;.net like&quot; if that is a mark of the quality:

    //
    // .net string.format like function
    // usage:   &quot;{0} means &#039;zero&#039;&quot;.format(&quot;nula&quot;) 
    // returns: &quot;nula means &#039;zero&#039;&quot;
    // place holders must be in a range 0-99.
    // if no argument given for the placeholder, 
    // no replacement will be done, so
    // &quot;oops {99}&quot;.format(&quot;!&quot;)
    // returns the input
    // same placeholders will be all replaced 
    // with the same argument :
    // &quot;oops {0}{0}&quot;.format(&quot;!&quot;,&quot;?&quot;)
    // returns &quot;oops !!&quot;
    //
    if (&#039;function&#039; != typeof String.format)
        String.prototype.format = function() {
            var args = arguments;
            return this.replace(/\{(\d&#124;\d\d)\}/g, function($0) {
                var idx = 1 * $0.match(/\d+/)[0]; return args[idx] !== undefined ? args[idx] : (args[idx] === &quot;&quot; ? &quot;&quot; : $0);
            }
     );
        }

Thanks ...</description>
		<content:encoded><![CDATA[<p>I am really not your enemy, it is only that I think developers should be a bit more rigorous and scientific in their texts ;o)</p>
<p>Here what are you doing is comparing apples and pears. JavaScript is a language and .NET is an runtime environment. Which is on top of that also: language agnostic.</p>
<p>Comparing JavaScript to C# might have much more sense.<br />
But it seems to me, the most sensible approach would be not to mention .NET or C# at all and just present the solution.</p>
<p>There is a simple but very useful general format() which is also &#034;.net like&#034; if that is a mark of the quality:</p>
<p>    //<br />
    // .net string.format like function<br />
    // usage:   &#034;{0} means &#039;zero&#039;&#034;.format(&#034;nula&#034;)<br />
    // returns: &#034;nula means &#039;zero&#039;&#034;<br />
    // place holders must be in a range 0-99.<br />
    // if no argument given for the placeholder,<br />
    // no replacement will be done, so<br />
    // &#034;oops {99}&#034;.format(&#034;!&#034;)<br />
    // returns the input<br />
    // same placeholders will be all replaced<br />
    // with the same argument :<br />
    // &#034;oops {0}{0}&#034;.format(&#034;!&#034;,&#034;?&#034;)<br />
    // returns &#034;oops !!&#034;<br />
    //<br />
    if (&#039;function&#039; != typeof String.format)<br />
        String.prototype.format = function() {<br />
            var args = arguments;<br />
            return this.replace(/\{(\d|\d\d)\}/g, function($0) {<br />
                var idx = 1 * $0.match(/\d+/)[0]; return args[idx] !== undefined ? args[idx] : (args[idx] === &#034;&#034; ? &#034;&#034; : $0);<br />
            }<br />
     );<br />
        }</p>
<p>Thanks &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/javascript-date-formatting-net-style/comment-page-1/#comment-26018</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Sun, 16 Aug 2009 22:15:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/javascript-date-formatting-net-style/#comment-26018</guid>
		<description>@Greg: great to hear because you will need all your skills to get the job done. First of all you would need a mechanism to distinct on which Web Part you&#039;re working. You could do it for example by retrieving the title (I don&#039;t know the exact selectors but these shouldn&#039;t be that difficuly to figure out using either the IE developer tools/toolbar or Firebug). Then you would perform the rendering depending on the Web Part type. Of course retrieving the dates from the contents of your Web Parts is specific to your case. Basically it&#039;s all about finding the right selectors to get the content out of the page.
Let me know should you have any more questions.

Good Luck!</description>
		<content:encoded><![CDATA[<p>@Greg: great to hear because you will need all your skills to get the job done. First of all you would need a mechanism to distinct on which Web Part you&#039;re working. You could do it for example by retrieving the title (I don&#039;t know the exact selectors but these shouldn&#039;t be that difficuly to figure out using either the IE developer tools/toolbar or Firebug). Then you would perform the rendering depending on the Web Part type. Of course retrieving the dates from the contents of your Web Parts is specific to your case. Basically it&#039;s all about finding the right selectors to get the content out of the page.<br />
Let me know should you have any more questions.</p>
<p>Good Luck!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://blog.mastykarz.nl/javascript-date-formatting-net-style/comment-page-1/#comment-26016</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Sun, 16 Aug 2009 21:41:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/javascript-date-formatting-net-style/#comment-26016</guid>
		<description>My only experience with Javascript and JQuery is to add code to a hidden CEWP on a Sharepoint page. So, that is fairly limited.
I would need to format dates differently depending of the webpart they belong to.
Greg</description>
		<content:encoded><![CDATA[<p>My only experience with Javascript and JQuery is to add code to a hidden CEWP on a Sharepoint page. So, that is fairly limited.<br />
I would need to format dates differently depending of the webpart they belong to.<br />
Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/javascript-date-formatting-net-style/comment-page-1/#comment-25974</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Sat, 15 Aug 2009 21:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/javascript-date-formatting-net-style/#comment-25974</guid>
		<description>@Greg: could you provide me with some more details about what you want to achieve? Is there anything in the article above that you don&#039;t understand?</description>
		<content:encoded><![CDATA[<p>@Greg: could you provide me with some more details about what you want to achieve? Is there anything in the article above that you don&#039;t understand?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://blog.mastykarz.nl/javascript-date-formatting-net-style/comment-page-1/#comment-25962</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Sat, 15 Aug 2009 16:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/javascript-date-formatting-net-style/#comment-25962</guid>
		<description>Hi,
I am totally new to JS - bad - but eager  to learn - good?
How should I use this code to format dates on a SP page?
Greg</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I am totally new to JS &#8211; bad &#8211; but eager  to learn &#8211; good?<br />
How should I use this code to format dates on a SP page?<br />
Greg</p>
]]></content:encoded>
	</item>
</channel>
</rss>

