diff options
author | Nick Thomas <nick@gitlab.com> | 2019-09-03 16:49:16 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-09-03 16:49:16 +0300 |
commit | bc26349b76ccde5dc0edba19ab48c6bd0d3f8adf (patch) | |
tree | 3eb2e69a5618c55d00541b5866699f0eebb78577 /app | |
parent | 1068ec2e9201af3de1fc5ebe9c8d9f7953c89b51 (diff) | |
parent | 8e6e1e1d155c39a770600ccaf51b9c617463fd19 (diff) |
Merge branch '62591-fix-milestone-due-date-today-wording' into 'master'
Fix wording on milestone due date today
Closes #62591
See merge request gitlab-org/gitlab-ce!32096
Diffstat (limited to 'app')
-rw-r--r-- | app/serializers/entity_date_helper.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/serializers/entity_date_helper.rb b/app/serializers/entity_date_helper.rb index f515abe5917..d8f267d7183 100644 --- a/app/serializers/entity_date_helper.rb +++ b/app/serializers/entity_date_helper.rb @@ -46,12 +46,14 @@ module EntityDateHelper # If start date is provided and elapsed, with no due date, it returns "# days elapsed" def remaining_days_in_words(due_date, start_date = nil) if due_date&.past? - content_tag(:strong, 'Past due') + content_tag(:strong, _('Past due')) + elsif due_date&.today? + content_tag(:strong, _('Today')) elsif start_date&.future? - content_tag(:strong, 'Upcoming') + content_tag(:strong, _('Upcoming')) elsif due_date is_upcoming = (due_date - Date.today).to_i > 0 - time_ago = time_ago_in_words(due_date) + time_ago = distance_of_time_in_words(due_date, Date.today) # https://gitlab.com/gitlab-org/gitlab-ce/issues/49440 # @@ -59,8 +61,8 @@ module EntityDateHelper # of the string instead of piecewise translations. content = time_ago .gsub(/\d+/) { |match| "<strong>#{match}</strong>" } - .remove("about ") - remaining_or_ago = is_upcoming ? _("remaining") : _("ago") + .remove('about ') + remaining_or_ago = is_upcoming ? _('remaining') : _('ago') "#{content} #{remaining_or_ago}".html_safe elsif start_date&.past? |