Hello,
i'm working on projeqtor for my traineeship, and i think i found a bug in the function workDayDiffDates, in view/js/projeqtor.js at the line 2724 in projeqtor v7.0.5.
In some cases, the result it returns is larger than the number of working days expected.
First of all, two examples:
If i create an activity with a start date and an end date set each at 01/05/2018, a date which has been set as an off day beforehand in calendar, the validated duration indicated is 1 day,
and not 0 day as expected (after saving, the duration is set at 0, so this bug doesn't affect the database).
Similarly, if i take a startdate such as the monday 14/05/18 and an end date at the saturday 19/05/18 (saturday is Day Off in Global Parameters), the duration is 6 days and not 5.
Here a proposition for the correction:
Thanks
In my opinion, this is not an issue.
If work is done on off day, then duration is at least 1, not zero.
The same way, if I start on friday and end on saturday, of course duration is 2 days (I worked during off days).
Well i agree that it's possible to work during off days, but may i point two problems then ?
Why, after i save with the case in which start date and end date are set to 01/05/2018 (an off day), validated duration has become "0 d" and not "1 d" ?
There seems to be an inconsistency between the js and php.
And also, why when i take a start date set at friday 04/05/2018 and end date set at saturday 05/04/2018 (saturday is set as OffDays),
validated duration is "2 d" in js and "1 d" in php (after saving the activity) ? Which one is valid (js or php) ?
Here are the two functions (js and php), and as you can see, the variable duration is set to 1 in projeqtor.js and to 0 projeqtor.php.
Thanks
Hi,
Thanks for pointing this out.
In my opinion, PHP is wrong.
Duration must not be zero, never.
Only milestones have zero duration.
We'll fox it in php part.
Thanks for pointing out this issue
Fix will be included in V7.0.5
Your patch will also be included.
Thanks for your contribution.






