Forum

Diary Display bug
 
Notifications
Retirer tout

Diary Display bug

4 Posts
2 Utilisateurs
0 Reactions
4,067 Vu
puget
(@bpuget)
Posts: 13
Active Member
Début du sujet
 
[#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 ?


 
Posté : 3 Déc PM 19:1212
(@babynus)
Posts: 14952
Membre Admin
 

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


 
Posté : 3 Déc PM 21:1212
puget
(@bpuget)
Posts: 13
Active Member
Début du sujet
 

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


 
Posté : 4 Déc AM 11:1212
(@babynus)
Posts: 14952
Membre Admin
 

You contribution is included in V5.2

Thank you !


 
Posté : 4 Déc PM 20:1212
Share:
Retour en haut