View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Bug's correction proposal: duration calculation (projeqtor.js:workDaysDiffDates) - ProjeQtOr
 
 

Bug's correction proposal: duration calculation (projeqtor.js:workDaysDiffDates)

More
24 Apr 2018 16:23 #1 by Glaurung4567
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

Please Log in or Create an account to join the conversation.

More
24 Apr 2018 19:59 #2 by babynus
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).

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
26 Apr 2018 11:40 #3 by Glaurung4567
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
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Apr 2018 12:46 #4 by babynus
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

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
26 Apr 2018 16:53 #5 by Glaurung4567
Hi,
Thanks you for your answer and can you notify me when you have fixed this issue ?

Also, did you notice this proposal of code to correct a problem with DateTime in projeqtor.js/workdaysdiffDates ?
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Apr 2018 22:37 #6 by babynus
Fix will be included in V7.0.5
Your patch will also be included.

Thanks for your contribution.

Babynus
Administrator of ProjeQtOr web site
The following user(s) said Thank You: Glaurung4567

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.094 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.