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
f3a2d462
Commit
f3a2d462
authored
15 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Trim string
parent
9bcf643c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/lib/date.lib.php
+3
-3
3 additions, 3 deletions
htdocs/lib/date.lib.php
with
3 additions
and
3 deletions
htdocs/lib/date.lib.php
+
3
−
3
View file @
f3a2d462
...
@@ -43,7 +43,7 @@ function ConvertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
...
@@ -43,7 +43,7 @@ function ConvertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
* \param format Output format (all: complete display, hour: displays only hours, min: displays only minutes)
* \param format Output format (all: complete display, hour: displays only hours, min: displays only minutes)
* \param lengthOfDay Length of day (default 86400 seconds)
* \param lengthOfDay Length of day (default 86400 seconds)
* \return sTime Formated text of duration
* \return sTime Formated text of duration
* \example 0 return 0
h
00, 3600 return 1
h
00, 86400 return 1d, 90000 return 1
d
ay
1hour
* \example 0 return 0
0:
00, 3600 return 1
:
00, 86400 return 1d, 90000 return 1
D
ay
01:00
*
*
*/
*/
function
ConvertSecondToTime
(
$iSecond
,
$format
=
'all'
,
$lengthOfDay
=
86400
)
function
ConvertSecondToTime
(
$iSecond
,
$format
=
'all'
,
$lengthOfDay
=
86400
)
...
@@ -67,7 +67,7 @@ function ConvertSecondToTime($iSecond,$format='all',$lengthOfDay=86400)
...
@@ -67,7 +67,7 @@ function ConvertSecondToTime($iSecond,$format='all',$lengthOfDay=86400)
}
}
$sTime
=
''
;
$sTime
=
''
;
if
(
$sDay
)
$sTime
.
=
$sDay
.
' '
.
$dayTranslate
.
' '
;
if
(
$sDay
)
$sTime
.
=
$sDay
.
' '
.
$dayTranslate
.
' '
;
if
(
$iSecond
)
if
(
$iSecond
||
empty
(
$sDay
)
)
{
{
$sTime
.
=
dol_print_date
(
$iSecond
,
'hour'
,
true
);
$sTime
.
=
dol_print_date
(
$iSecond
,
'hour'
,
true
);
}
}
...
@@ -80,7 +80,7 @@ function ConvertSecondToTime($iSecond,$format='all',$lengthOfDay=86400)
...
@@ -80,7 +80,7 @@ function ConvertSecondToTime($iSecond,$format='all',$lengthOfDay=86400)
{
{
$sTime
=
dol_print_date
(
$iSecond
,
'%M'
,
true
);
$sTime
=
dol_print_date
(
$iSecond
,
'%M'
,
true
);
}
}
return
$sTime
;
return
trim
(
$sTime
)
;
}
}
...
...
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