Het loopt een bekke mis ergens, maar ik vind het niet waar.
http://tools.weblayout.be/calendar5/index.php?month=1&year=2014 (weeknummers zijn nog niet op de juiste plaats, staat helemaal vanonder)
hier is de berekening van de weeknummers, mischien gebruik ik het verkeerde formaat, iemand een idee ?
<?php
if (isset($_GET['month']) && isset($_GET['year']))
{
$this_month = cleanQuery($_GET['month']);
$this_year = cleanQuery($_GET['year']);
if ($this_month == 13)
{
$this_month = 1;
$this_year = $this_year + 1;
}
elseif ($this_month == 0)
{
$this_month = 12;
$this_year = $this_year - 1;
}
else
{
$this_month = $this_month;
}
}
else
{
$this_month = date("n");
$this_year = date("Y");
}
?>
<?php
$days_of_the_month = date("t", mktime(0, 0, 0, $this_month, 1, $this_year));
$first_weeknumber_of_the_month = strftime("%W", mktime(0,0,0,$this_month,1,$this_year));
$last_weeknumber_of_the_month = strftime("%W", mktime(0,0,0,$this_month,$days_of_the_month,$this_year));
$weeknumber = $first_weeknumber_of_the_month;
echo "<ul id=\"weeknumbers\">";
echo "<li>W</li>";
while ($weeknumber <= $last_weeknumber_of_the_month)
{
echo "<li>".$weeknumber."</li>";
$weeknumber++;
}
echo "</ul>";
?>