1 commit erreicht immer genau die erste stufe $week = 0; while($date->format('Y') == $year) { if ($date > new DateTime()) {// THE FUTURE, SPONGEBOB while ($date->format('d') != $date->format('t')) { if ($date->format('N') == 1 && $date->format('z') > 0) { $week++; } $date = $date->modify("+1 day"); } $monthlist[$date->format('m') - 1][1] = $week + ($wday / 7); $date = $date->modify("+1 year"); // Kill continue; } $c_count = $ymap[$date->format('Y-m-d')]; $color_idx = min((count($COLORS)-1), ceil(pow($c_count/$ymapmax, $exponent) * (count($COLORS)-1))); $color = $COLORS[$color_idx]; $wday = ($date->format('N') - 1); if ($date->format('N') == 1 && $date->format('z') > 0) { echo '', PHP_EOL; $week++; echo '', PHP_EOL; } if ($date->format('d') == 1) { $monthlist[$date->format('m') - 1][0] = $week + ($wday / 7); } else if ($date->format('d') == $date->format('t')) { $monthlist[$date->format('m') - 1][1] = $week + ($wday / 7); } echo '', PHP_EOL; $date = $date->modify("+1 day"); } ?> 0) { $posx = (($monthlist[$i][0]+$monthlist[$i][1])/2) * $DIST_X; echo '' . $MONTHS[$i] . ''; } } for($i = 0; $i < 7; $i++) { echo '' . $DAYS[$i] . ''; } echo '' . $year . ''; ?>