fix for gnu-bug #136:

dates in week-selectbox are (sometimes) wrong, the endate of a week is the same as the startdate of the next one

This is caused by changes in daylight saveing and useing midnight for the calculation, changed it to midday
This commit is contained in:
Ralf Becker 2003-03-09 21:05:29 +00:00
parent 42e8f97101
commit 1b49725830

View File

@ -2612,8 +2612,9 @@
$str = '';
for ($i = -7; $i <= 7; $i++)
{
$begin = $sun + (604800 * $i);
$end = $begin + 604799;
$begin = $sun + (7*24*60*60 * $i) + 12*60*60; // we use midday, that changes in daylight-saveing does not effect us
$end = $begin + 6*24*60*60;
// echo "<br>$i: ".date('d.m.Y H:i',$begin).' - '.date('d.m.Y H:i',$end);
$str .= '<option value="' . $GLOBALS['phpgw']->common->show_date($begin,'Ymd') . '"'.($begin <= $thisdate && $end >= $thisdate?' selected':'').'>'
. $GLOBALS['phpgw']->common->show_date($begin,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']) . ' - '
. $GLOBALS['phpgw']->common->show_date($end,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);