{for $i = 1; $i <= 7; $i++}{/for} {php} $numberOfDays = date('t', strtotime($date)); $dayOfWeek = date('N', strtotime($date . '-1')); $lastDayOfWeek = 7 - date('N', strtotime($date . '-' . $numberOfDays)); $dayOfWeekColspan = $dayOfWeek - 1; $lastDayOfWeekColspan = $lastDayOfWeek - 1; {/php} {if $dayOfWeek > 1}{/if} {php} $weekCounter = $dayOfWeek - 1; for ($i = 1; $i <= $numberOfDays; $i++) { {/php}{php} $weekCounter++; if ($weekCounter % 7 == 0) { {/php}{php} } } {/php} {if $lastDayOfWeek > 1}{/if}
«   {$nowYear}年{$nowMonth}月   »
{$lang['week_abbr'][$i]}
{if isset($arraydate[$i])}{$i}{else}{$i}{/if}