summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergiu Marton <brown121407@gmail.com>2019-04-03 18:21:15 +0000
committerAnnabel Dunstone Gray <annabel.m.gray@gmail.com>2019-04-03 18:21:15 +0000
commit448d0bc3e14fa7923f6537864c75d750b882f54f (patch)
tree5f0960f33aae674fff76563bf3e446cbc6c5a882
parent3de4399406eab3a34d9c07c31a99bc5e32de310e (diff)
downloadgitlab-ce-448d0bc3e14fa7923f6537864c75d750b882f54f.tar.gz
Replace 'x seconds ago' with 'just now'
-rw-r--r--app/assets/javascripts/lib/utils/datetime_utility.js10
-rw-r--r--changelogs/unreleased/fix-issues-time-counter.yml5
-rw-r--r--locale/gitlab.pot3
3 files changed, 12 insertions, 6 deletions
diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js
index d3fe8f77bd4..4d6327840db 100644
--- a/app/assets/javascripts/lib/utils/datetime_utility.js
+++ b/app/assets/javascripts/lib/utils/datetime_utility.js
@@ -92,7 +92,7 @@ export const getTimeago = () => {
const timeAgoLocaleRemaining = [
() => [s__('Timeago|just now'), s__('Timeago|right now')],
- () => [s__('Timeago|%s seconds ago'), s__('Timeago|%s seconds remaining')],
+ () => [s__('Timeago|just now'), s__('Timeago|%s seconds remaining')],
() => [s__('Timeago|1 minute ago'), s__('Timeago|1 minute remaining')],
() => [s__('Timeago|%s minutes ago'), s__('Timeago|%s minutes remaining')],
() => [s__('Timeago|1 hour ago'), s__('Timeago|1 hour remaining')],
@@ -121,7 +121,7 @@ export const getTimeago = () => {
const timeAgoLocale = [
() => [s__('Timeago|just now'), s__('Timeago|right now')],
- () => [s__('Timeago|%s seconds ago'), s__('Timeago|in %s seconds')],
+ () => [s__('Timeago|just now'), s__('Timeago|in %s seconds')],
() => [s__('Timeago|1 minute ago'), s__('Timeago|in 1 minute')],
() => [s__('Timeago|%s minutes ago'), s__('Timeago|in %s minutes')],
() => [s__('Timeago|1 hour ago'), s__('Timeago|in 1 hour')],
@@ -160,7 +160,11 @@ export const getTimeago = () => {
* @param {Boolean} setTimeago
*/
export const localTimeAgo = ($timeagoEls, setTimeago = true) => {
- getTimeago().render($timeagoEls, timeagoLanguageCode);
+ getTimeago();
+
+ $timeagoEls.each((i, el) => {
+ $(el).text(timeagoInstance.format($(el).attr('datetime'), timeagoLanguageCode));
+ });
if (!setTimeago) {
return;
diff --git a/changelogs/unreleased/fix-issues-time-counter.yml b/changelogs/unreleased/fix-issues-time-counter.yml
new file mode 100644
index 00000000000..76f17063db5
--- /dev/null
+++ b/changelogs/unreleased/fix-issues-time-counter.yml
@@ -0,0 +1,5 @@
+---
+title: Make time counters show 'just now' for everything under one minute
+merge_request: 25992
+author: Sergiu Marton
+type: changed
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 6caaab7c2f3..f9c411642c7 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -8359,9 +8359,6 @@ msgstr ""
msgid "Timeago|%s months remaining"
msgstr ""
-msgid "Timeago|%s seconds ago"
-msgstr ""
-
msgid "Timeago|%s seconds remaining"
msgstr ""