Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-07-10 13:49:28 +0300
committerRémy Coutable <remy@rymai.me>2018-07-10 13:49:28 +0300
commit433189c85edac278ac6952a04745db2a02d50a14 (patch)
tree0aeb60d6e787146e7ea14d3bd20901a29c05d61e /app
parent7407efe19cab09a14147e8acc88213274694b614 (diff)
parent8aac79be5311ff6e545f9756a60b4b1c07885a76 (diff)
Merge branch 'syntax-test-branch' into 'master'
Update time_helper.rb to fix output for exact minutes. Closes #48948 See merge request gitlab-org/gitlab-ce!20479
Diffstat (limited to 'app')
-rw-r--r--app/helpers/time_helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/time_helper.rb b/app/helpers/time_helper.rb
index 271e839692a..336385f6798 100644
--- a/app/helpers/time_helper.rb
+++ b/app/helpers/time_helper.rb
@@ -5,9 +5,13 @@ module TimeHelper
seconds = interval_in_seconds - minutes * 60
if minutes >= 1
- "#{pluralize(minutes, "minute")} #{pluralize(seconds, "second")}"
+ if seconds % 60 == 0
+ pluralize(minutes, "minute")
+ else
+ [pluralize(minutes, "minute"), pluralize(seconds, "second")].to_sentence
+ end
else
- "#{pluralize(seconds, "second")}"
+ pluralize(seconds, "second")
end
end