Formats timeago dates to be more friendly
Formats the timeago timestamps to be a short date. This will only be visible on slower connections whilst the JS is loading, after the JS has loaded it will be turned into a timeago string Closes #27537
This commit is contained in:
parent
22fd68ab70
commit
8aa757aa53
2 changed files with 5 additions and 1 deletions
|
@ -166,7 +166,7 @@ module ApplicationHelper
|
||||||
css_classes = short_format ? 'js-short-timeago' : 'js-timeago'
|
css_classes = short_format ? 'js-short-timeago' : 'js-timeago'
|
||||||
css_classes << " #{html_class}" unless html_class.blank?
|
css_classes << " #{html_class}" unless html_class.blank?
|
||||||
|
|
||||||
element = content_tag :time, time.to_s,
|
element = content_tag :time, time.strftime("%b %d, %Y"),
|
||||||
class: css_classes,
|
class: css_classes,
|
||||||
title: time.to_time.in_time_zone.to_s(:medium),
|
title: time.to_time.in_time_zone.to_s(:medium),
|
||||||
datetime: time.to_time.getutc.iso8601,
|
datetime: time.to_time.getutc.iso8601,
|
||||||
|
|
4
changelogs/unreleased/format-timeago-date.yml
Normal file
4
changelogs/unreleased/format-timeago-date.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Format timeago date to short format
|
||||||
|
merge_request:
|
||||||
|
author:
|
Loading…
Reference in a new issue