diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index dd29d84cbc3..8742e4d91af 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1210,6 +1210,8 @@ if (empty($action) || $action == 'show_month') // View by month print '
'; print ''; print ' '; + // Column title of weeks numbers + echo ' '; $i = 0; while ($i < 7) { @@ -1232,6 +1234,24 @@ if (empty($action) || $action == 'show_month') // View by month //var_dump($eventarray); for ($iter_week = 0; $iter_week < 6; $iter_week++) { echo " \n"; + // Get date of the current day, format 'yyyy-mm-dd' + if ($tmpday <= 0) // If number of the current day is in previous month + { + $currdate0 = sprintf("%04d", $prev_year).sprintf("%02d", $prev_month).sprintf("%02d", $max_day_in_prev_month + $tmpday); + } + elseif ($tmpday <= $max_day_in_month) // If number of the current day is in current month + { + $currdate0 = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $tmpday); + } + else // If number of the current day is in next month + { + $currdate0 = sprintf("%04d", $next_year).sprintf("%02d", $next_month).sprintf("%02d", $tmpday - $max_day_in_month); + } + // Get week number for the targeted date '$currdate0' + $numweek0 = date("W", strtotime(date($currdate0))); + // Show the week number, and define column width + echo ' '; + for ($iter_day = 0; $iter_day < 7; $iter_day++) { if ($tmpday <= 0) { /* Show days before the beginning of the current month (previous month) */
#
'.$numweek0.'