Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
5b22eee9
Commit
5b22eee9
authored
9 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
FIX #4099
parent
3485e351
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/core/lib/date.lib.php
+6
-4
6 additions, 4 deletions
htdocs/core/lib/date.lib.php
with
6 additions
and
4 deletions
htdocs/core/lib/date.lib.php
+
6
−
4
View file @
5b22eee9
...
...
@@ -540,9 +540,10 @@ function dol_get_first_day_week($day,$month,$year,$gm=false)
* @param int $timestampStart Timestamp de debut
* @param int $timestampEnd Timestamp de fin
* @param string $countrycode Country code
* @param int $lastday Last day is included, 0: no, 1:yes
* @return int Nombre de jours feries
*/
function
num_public_holiday
(
$timestampStart
,
$timestampEnd
,
$countrycode
=
'FR'
)
function
num_public_holiday
(
$timestampStart
,
$timestampEnd
,
$countrycode
=
'FR'
,
$lastday
=
0
)
{
$nbFerie
=
0
;
...
...
@@ -550,7 +551,8 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR')
if
(((
$timestampEnd
-
$timestampStart
)
%
86400
)
!=
0
)
return
'ErrorDates must use same hours and must be GMT dates'
;
$i
=
0
;
while
(
$timestampStart
<
$timestampEnd
&&
(
$i
<
50000
))
// Loop end when equals (Test on i is a security loop to avoid infinite loop)
while
((
(
$lastday
==
0
&&
$timestampStart
<
$timestampEnd
)
||
(
$lastday
&&
$timestampStart
<=
$timestampEnd
)
)
&&
(
$i
<
50000
))
// Loop end when equals (Test on i is a security loop to avoid infinite loop)
{
$ferie
=
false
;
$countryfound
=
0
;
...
...
@@ -718,7 +720,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR')
*
* @param int $timestampStart Timestamp start UTC
* @param int $timestampEnd Timestamp end UTC
* @param int $lastday Last day is included, 0: no
n
, 1:
oui
* @param int $lastday Last day is included, 0: no, 1:
yes
* @return int Number of days
*/
function
num_between_day
(
$timestampStart
,
$timestampEnd
,
$lastday
=
0
)
...
...
@@ -766,7 +768,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha
if
(
$timestampStart
<
$timestampEnd
)
{
$numdays
=
num_between_day
(
$timestampStart
,
$timestampEnd
,
$lastday
);
$numholidays
=
num_public_holiday
(
$timestampStart
,
$timestampEnd
,
$country_code
);
$numholidays
=
num_public_holiday
(
$timestampStart
,
$timestampEnd
,
$country_code
,
$lastday
);
$nbOpenDay
=
$numdays
-
$numholidays
;
$nbOpenDay
.
=
" "
.
$langs
->
trans
(
"Days"
);
if
(
$inhour
==
1
&&
$nbOpenDay
<=
3
)
$nbOpenDay
=
$nbOpenDay
*
24
.
$langs
->
trans
(
"HourShort"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment