Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
e9bd8b61
Commit
e9bd8b61
authored
Jul 06, 2016
by
Annabel Dunstone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update time format of duration
parent
96684317
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/helpers/time_helper.rb
app/helpers/time_helper.rb
+7
-0
app/views/projects/ci/pipelines/_pipeline.html.haml
app/views/projects/ci/pipelines/_pipeline.html.haml
+1
-1
No files found.
app/helpers/time_helper.rb
View file @
e9bd8b61
...
...
@@ -23,4 +23,11 @@ module TimeHelper
def
date_from_to
(
from
,
to
)
"
#{
from
.
to_s
(
:short
)
}
-
#{
to
.
to_s
(
:short
)
}
"
end
def
duration_in_numbers
(
finished_at
,
started_at
)
diff_in_seconds
=
finished_at
.
to_i
-
started_at
.
to_i
time_format
=
diff_in_seconds
<
3600
?
"%M:%S"
:
"%H:%M:%S"
Time
.
at
(
diff_in_seconds
).
utc
.
strftime
(
time_format
)
end
end
app/views/projects/ci/pipelines/_pipeline.html.haml
View file @
e9bd8b61
...
...
@@ -45,7 +45,7 @@
%td
-
if
pipeline
.
started_at
&&
pipeline
.
finished_at
%p
.duration
#{
duration_in_words
(
pipeline
.
finished_at
,
pipeline
.
started_at
)
}
=
duration_in_numbers
(
pipeline
.
finished_at
,
pipeline
.
started_at
)
%td
.controls.hidden-xs.pull-right
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment