<p>That's it !</p>
</div>
<h2>How to build a full calendar for the current year ?</h2>
<div>
<pre>
$jh_agenda->setCurrentYear(isset($_GET['year']) ? $_GET['year'] : null);
$jh_agenda->setCurrentMonth(isset($_GET['month']) ? $_GET['month'] : null);
$jh_agenda->buildMonthsPerYear()->prepareMonthsPerYear()->displayMonthsPerYear();
</pre>
</div>
<h2>How to build a specific month ?</h2>
<div>
<pre>
$jh_agenda = new JhAgenda();
$jh_agenda->setCurrentYear(2012);
$jh_agenda->setCurrentMonth(6);
$jh_agenda-&
61DD
;gt;buildDaysPerMonth();
$jh_agenda->prepareDaysPerMonth();
$jh_agenda->displayDaysPerMonth();
</pre>
<p>or if you chain it</p>
<pre>
$jh_agenda = new JhAgenda();
$jh_agenda->setCurrentYear(2012)->setCurrentMonth(6);
$jh_agenda->buildDaysPerMonth()->prepareDaysPerMonth()->displayDaysPerMonth();
</pre>
<p>Function setCurrentYear and setCurrentMonth are optional</p>
</div>
<h2>Why so many functions ?</h2>
<div>
<p>If you just want day's timestamp of the month, you can do:</p>
<pre>
$jh_agenda = new JhAgenda();
$timestamps = $jh_agenda->buildDaysPerMonth()->getDaysPerMonth();
</pre>
<p>Output:</p>
<pre>
Array
(
[0] => 1338501600
[1] => 1338588000
[2] => 1338674400
...
[27] => 1340834400
[28] => 1340920800
[29] => 1341007200
)
</pre>
<p>If you want a formatted array to make easier its display, use:</p>
<pre>
$jh_agenda = new JhAgenda();
$timestamps = $jh_agenda->buildDaysPerMonth()->prepareDaysPerMonth()->getDaysPerMonth();
</pre>
<p>Output:</p>
<pre>
Array
(
[head] => Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
)
[body] => Array
(
[0] => Array
(
[0] => 1338156000
[1] => 1338242400
[2] => 1338328800
[3] => 1338415200
[4] => 1338501600
[5] => 1338588000
[6] => 1338674400
)
[1] => Array
(
[0] => 1338760800
[1] => 1338847200
[2] => 1338933600
[3] => 1339020000
[4] => 1339106400
[5] => 1339192800
[6] => 1339279200
)
[2] => Array
(
[0] => 1339365600
[1] => 1339452000
[2] => 1339538400
[3] => 1339624800
[4] => 1339711200
[5] => 1339797600
[6] => 1339884000
)
[3] => Array
(
[0] => 1339970400
[1] => 1340056800
[2] => 1340143200
[3] => 1340229600
[4] => 1340316000
[5] => 1340402400
[6] => 1340488800
)
[4] => Array
(
[0] => 1340575200
[1] => 1340661600
[2] => 1340748000
[3] => 1340834400
[4] => 1340920800
[5] => 1341007200
[6] => 1341093600
)
)
)
</pre>
<p>[head] contains the seven days in a week. 1 is monday, ... 7 is sunday</p>
<p>[body] contains timestamp's days by number of week in the month. 4 weeks, 4 sub-arrays. 5 weeks, 5 sub-arrays</p>
</div>
<h2>How do I translate in another language ?</h2>
<div>
<p>In "jh_agenda.class.php" file, just change $months_labels, $days_labels and $weeks_label.</p>
</div>
<h2>The default view is not for me</h2>
<div>
<p>If the default view is not appropriate for you, you have two solutions :</p>
<ul>
<li>Edit displayDaysPerMonth() function directly</li>
<li>Create an extended class of JhAgenda and overload or create your function</li>
</ul>
</div>