dolibarr-bugtrack
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-bugtrack] [Bug #1287] Wrong use day in Holiday module


From: Doliforge
Subject: [Dolibarr-bugtrack] [Bug #1287] Wrong use day in Holiday module
Date: Sat, 15 Mar 2014 14:56:26 +0100

Doliforge
Ce message ne s'affiche pas correctement?
mettez à jour vos préférences utilisateur.

Wrong use day in Holiday module

Dernières modifications

15/03/2014 14:56 (Europe/Paris)
The bug has been corrected inside GIT sources
(http://www.github.com/Dolibarr/dolibarr).

So fix should be available with next stable release.
Changements :
  • Status: 
OpenClosed
  • Assigned to: 
AucunLaurent Destailleur (eldy)
  • Resolution: 
AucunWont Fix

Répondre

État

 Détails
Last Modified On:  05/03/2014 12:21 Submitted by:  HENRY Florian (fhenry)
Submitted on:  05/03/2014 12:19 
Summary:  Wrong use day in Holiday module
Description:  Create a holiday resquest for 28-march-2014 morning to 31-March-2014 afternoon
the number of working day use is 1, it whould be 2
Step to reproduce bug:  Create a holiday resquest for 28-march-2014 morning to 31-March-2014 afternoon
the number of working day use is 1, it whould be 2
Detected in version:  3.5.0 Category:  Module: Holidays
Severity:  5 - Major OS Type/Version:  
PHP version:   Database type and version:  
 Etat
Status:  Closed Assigned to:  Laurent Destailleur (eldy)
Resolution:  Wont Fix 

Commentaires

HENRY Florian 15/03/2014 14:56
The bug has been corrected inside GIT sources
(http://www.github.com/Dolibarr/dolibarr).

So fix should be available with next stable release.
HENRY Florian 05/03/2014 12:21
My case :
Find number of day betwenn 21-March-2014 and 24-March-2014 Result is 4 => OK (Friday,Saturday,Sunday,Monday)
Find number of day betwenn 28-March-2014 and 31-March-2014 Result is 3 => KO. (Friday,Saturday,Sunday,Monday)

If I look into code of this function we have a basic timestamp substraction, that should give a good result, but in fact not. Is it the only case ? I don't know.

I put some trace and there is the result :

21-24 :
$timestampStart=1395356400
$timestampEnd =1395615600
$bit=0
($timestampEnd - $timestampStart)/(60*60*24) +1 - $bits = 4
floor(4) = 4

28-31 :
$timestampStart=1395961200
$timestampEnd =1396216800
$bit=0
($timestampEnd - $timestampStart)/(60*60*24) + 1 - $bits = 3.9583333333333
floor(3.9583333333333) = 3


As we do a floor on this ($timestampEnd - $timestampStart)/(60*60*24) the second result is KO


reply via email to

[Prev in Thread] Current Thread [Next in Thread]