Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Diary Display bug
 
Notifications
Clear all

Diary Display bug

4 Posts
2 Users
0 Reactions
4,098 Views
puget
(@bpuget)
Posts: 13
Active Member
Topic starter
 
[#2786]

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 ?


 
Posted : 03 Dec 2015 19H16
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Of course, if you solved issue, please share !!! :woohoo:


 
Posted : 03 Dec 2015 21H50
puget
(@bpuget)
Posts: 13
Active Member
Topic starter
 

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).


 
Posted : 04 Dec 2015 11H52
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

You contribution is included in V5.2

Thank you !


 
Posted : 04 Dec 2015 20H35
Share:

Scroll to Top