Skip to content

Commit

Permalink
Fix we must user relative timezone of date.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 20, 2022
1 parent 3293a6f commit 6c0e333
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions htdocs/comm/action/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1546,19 +1546,19 @@ function setdatefields()
print '</td><td td colspan="3">';
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
if (GETPOST("afaire") == 1) {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} else {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
}
print ' - ';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} else {
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
}
print '</td></tr>';

Expand Down Expand Up @@ -1996,11 +1996,15 @@ function init_repeat()

// Date start
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td>';
// Test a date before the 27 march and one after
//print dol_print_date($object->datep, 'dayhour', 'gmt');
//print dol_print_date($object->datep, 'dayhour', 'tzuser');
//print dol_print_date($object->datep, 'dayhour', 'tzuserrel');
if (empty($object->fulldayevent)) {
print dol_print_date($object->datep, 'dayhour', 'tzuser');
print dol_print_date($object->datep, 'dayhour', 'tzuserrel');
} else {
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
print dol_print_date($object->datep, 'day', ($tzforfullday ? $tzforfullday : 'tzuser'));
print dol_print_date($object->datep, 'day', ($tzforfullday ? $tzforfullday : 'tzuserrel'));
}
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) {
print img_warning($langs->trans("Late"));
Expand All @@ -2011,10 +2015,10 @@ function init_repeat()
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td>';
if (empty($object->fulldayevent)) {
print dol_print_date($object->datef, 'dayhour', 'tzuser');
print dol_print_date($object->datef, 'dayhour', 'tzuserrel');
} else {
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
print dol_print_date($object->datef, 'day', ($tzforfullday ? $tzforfullday : 'tzuser'));
print dol_print_date($object->datef, 'day', ($tzforfullday ? $tzforfullday : 'tzuserrel'));
}
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) {
print img_warning($langs->trans("Late"));
Expand Down

0 comments on commit 6c0e333

Please sign in to comment.