Fix tz pb in week view

This commit is contained in:
Laurent Destailleur 2021-02-18 17:07:39 +01:00
parent 9d12aeee49
commit 27818b68ae

View File

@ -1343,14 +1343,14 @@ if (empty($action) || $action == 'show_month') // View by month
for ($iter_day = 0; $iter_day < 7; $iter_day++) { for ($iter_day = 0; $iter_day < 7; $iter_day++) {
// Show days of the current week // Show days of the current week
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server
$tmparray = dol_getdate($curtime, true); $tmpday = dol_print_date($curtime, '%d', 'tzuserrel');
$tmpday = $tmparray['mday']; $tmpmonth = dol_print_date($curtime, '%m', 'tzuserrel');
$tmpmonth = $tmparray['mon']; $tmpyear = dol_print_date($curtime, '%Y', 'tzuserrel');
$tmpyear = $tmparray['year'];
$style = 'cal_current_month'; $style = 'cal_current_month';
if ($iter_day == 6) $style .= ' cal_other_month_right'; if ($iter_day == 6) $style .= ' cal_other_month_right';
$today = 0; $today = 0;
$todayarray = dol_getdate($now, 'fast'); $todayarray = dol_getdate($now, 'fast');
if ($todayarray['mday'] == $tmpday && $todayarray['mon'] == $tmpmonth && $todayarray['year'] == $tmpyear) $today = 1; if ($todayarray['mday'] == $tmpday && $todayarray['mon'] == $tmpmonth && $todayarray['year'] == $tmpyear) $today = 1;