Hi,
I've found anomaly when displaying Diary. As shown in capture1 (see attached screenshot), there are more weeks displayed than the necessary Weeks shown in my browser tab. But we can't select days in the bottom of Diary ! => days in additional weeks are inaccessible !
After correcting this anomaly, I found a bug on the calculation of the number of the week on January. The bug occurs when first week of year is 52 or 53.
I have a solution for this issue. I fixed all this to get a new version of Diary.php. Are you interested ?
Of course, if you solved issue, please share !!! :woohoo:
In Diary.php, find part of code beginning with
$projectColorArray=array();
and ending with
} else if ($period=="week") {
, and paste these lines :
$projectColorArray=array();
$projectNameArray=array();
$trHeight=100;
if ($period=="month") {
$week=weekNumber($year.'-'.$month.'-01');
$lastWeek=weekNumber($year.'-'.$month.'-'.intval(date("t",$month)));
if ($lastWeek>$week) {
$trHeight=round(100/($lastWeek-$week+1))-1;
} else {
$trHeight=round(100/($lastWeek+1))-1;
}
}
if ($period=="month") {
if ($month=='01' and $week>50) {
$currentDay=date('Y-m-d',firstDayofWeek($week,$year-1));
} else {
$currentDay=date('Y-m-d',firstDayofWeek($week,$year));
}
$lastDayOfMonth=date('t',strtotime($year.'-'.$month.'-01'));
$weekOfLastDayOfMonth=date('W',strtotime($year.'-'.$month.'-'.$lastDayOfMonth));
$firstDayOfLastWeek=date('Y-m-d',firstDayofWeek($weekOfLastDayOfMonth, $year ));
$endDay=addDaysToDate($firstDayOfLastWeek, 6);
$inScopeDay=false;
} else if ($period=="week") {
I'm not sure it works fine in all contextes (IE8 : strange, Chrome : OK).
You contribution is included in V5.2
Thank you !