Forum

bug in reports => p...
 
Notifications
Clear all

bug in reports => planning => work plan per week

3 Posts
3 Users
0 Reactions
3,876 Views
(@samfaitmal)
Posts: 3
Active Member
Topic starter
 
[#639]

When you have planned activities over 2013, trying to get this report enters in an endless loop.

I have investigated the bug and the result is that function weekFormat from projector.php is wrong:

function weekFormat($dateValue) { 
    return date('Y-W', strtotime ($dateValue) );       
} 

This year, week 52 ends on december the 30th.
Monday 31th is assumed to be in week 1 of year 2013.
But weekFormat(), when you provide "2012-12-31" as $dateValue returns "2012-01".
So, a test for similar cases shall be added to weekFormat in order to avoid the bug.

Regards,
Sam


 
Posted : 27 Aug 2012 20H22
(@a-mikael)
Posts: 35
Active Member
 

Hello,

I think I have any solution :

$w = (date('W', strtotime ($dateValue)));
$m = (date('m', strtotime ($dateValue)));

if($w == 1 && $m == 12)
{
  return date("Y-W", strtotime("+1 year", strtotime($dateValue."-01" )));
}
else return date('Y-W', strtotime ($dateValue)); 

 
Posted : 04 Dec 2012 13H48
(@babynus)
Posts: 14952
Member Admin
 

Great !

Fixing will be included in V3.1.

Thanks for your contribution.


 
Posted : 04 Dec 2012 16H55
Share:

Scroll to Top