CSS on current day

This commit is contained in:
Laurent Destailleur 2026-02-03 12:30:03 +01:00
parent ac5b2c994b
commit 581aafdbff
2 changed files with 13 additions and 4 deletions

View file

@ -1941,8 +1941,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
$dateint = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
//print 'show_day_events day='.$day.' month='.$month.' year='.$year.' dateint='.$dateint;
$datenowint = dol_print_date(dol_now(), "%Y%m%d");
//print 'show_day_events day='.$day.' month='.$month.' year='.$year.' dateint='.$dateint.' datenowint='.$datenowint;
print "\n";
@ -1961,11 +1961,13 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($nonew <= 0) {
print '<div class="tagtr cursorpointer" onclick="window.location=\''.$urltocreate.'\';"><div class="nowrap tagtd"><div class="left inline-block">';
print '<a class="dayevent-aday" style="color: #666" href="'.$urltoshow.'">';
print ($datenowint == $dateint ? '<span class="badgeneutral">' : '');
if ($showinfo) {
print dol_print_date($curtime, 'daytextshort');
} else {
print dol_print_date($curtime, '%d');
}
print ($datenowint == $dateint ? '</span>' : '');
print '</a>';
print '</div><div class="nowrap floatright inline-block marginrightonly">';
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {

View file

@ -1593,9 +1593,16 @@ while ($currentdaytoshow < $lastdaytoshow) {
echo '<span class="bold spandayofweek">'.$langs->trans("Day".(($i + getDolGlobalInt('MAIN_START_WEEK', 1)) % 7)).'</span>';
print "<br>";
if ($i) {
print dol_print_date(dol_time_plus_duree($currentdaytoshow, $i, 'd'), 'day', 'tzuserrel');
$valtoshow = dol_time_plus_duree($currentdaytoshow, $i, 'd');
} else {
print dol_print_date($currentdaytoshow, 'day', 'tzuserrel');
$valtoshow = $currentdaytoshow;
}
if (dol_print_date($valtoshow, '%Y%m%d') == dol_print_date(dol_now(), '%Y%m%d')) {
echo '<span class="badgeneutral">';
}
print dol_print_date($valtoshow, 'dayreduceformat', 'tzuserrel');
if (dol_print_date($valtoshow, '%Y%m%d') == dol_print_date(dol_now(), '%Y%m%d')) {
echo '</span>';
}
echo "</td>\n";
$i++;