<?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>Riding The Breeze &#187; MovableType</title>
	<atom:link href="http://www.iliveinperego.com/category/movabletype/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iliveinperego.com</link>
	<description>Yes !</description>
	<lastBuildDate>Fri, 12 Feb 2010 09:46:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Monday first in MovableType calendar</title>
		<link>http://www.iliveinperego.com/2009/02/monday-first-in-movabletype-calendar/</link>
		<comments>http://www.iliveinperego.com/2009/02/monday-first-in-movabletype-calendar/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 22:24:28 +0000</pubDate>
		<dc:creator>hpatoio</dc:creator>
				<category><![CDATA[MovableType]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/?p=218</guid>
		<description><![CDATA[When you display a calendar in Movabletype using tags from Calendar&#039;s set you get a calendar with Sunday as first day of the week.
In many countries (like Italy) weeks start on Monday, so, I needed to change this beahvior. I thought I could change something in the &#034;Settings&#034; panel or in the Config file to [...]]]></description>
			<content:encoded><![CDATA[<p>When you display a calendar in Movabletype using tags from Calendar&#039;s set you get a calendar with Sunday as first day of the week.</p>
<p>In many countries (like Italy) weeks start on Monday, so, I needed to change this beahvior. I thought I could change something in the &#034;Settings&#034; panel or in the Config file to achive this but I was wrong !</p>
<p>After a short searching I realized that I wasn&#039;t the only one with this problem, and I&#039;ve also found this <a title="See the solution." href="http://forums.sixapart.com/lofiversion/index.php/t4095.html">solution</a> that works by shifting by one the day returned by <em>wday_from_ts</em>.</p>
<p>At the beginning everything seemed to works fine but I immediately realized that this hack effected also the result of tags connected to a date like <em>&lt;$mt:EntryDate$&gt;.</em> Basically instead of getting <em><strong>Sunday</strong> February 1th 2009</em> I was getting <em><strong>Saturday</strong> February 1th 2009</em>, as you can imagine, this is quite a big problem, especially for a blog where date matters.</p>
<p>I started to look for another way to solve the problem and I realized that the only possibility was modify the function that handle the calendar tags.</p>
<h3>The Solution</h3>
<p>Open <em>/lib/MT/Template/ContextHandlers.pm </em>and modify these 2 lines from</p>
<p><code>my $pad_start = wday_from_ts($y, $m, 1);<br />
my $pad_end = 6 - wday_from_ts($y, $m, $days_in_month);</code></p>
<p>to</p>
<p><code>my $pad_start_tmp = wday_from_ts($y, $m, 1);<br />
my $pad_start = ($pad_start_tmp == 0) ? 6 : $pad_start_tmp - 1;<br />
my $pad_end = wday_from_ts($y, $m, $days_in_month) + 1;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2009/02/monday-first-in-movabletype-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
