diff options
author | Francis Murillo <evacuee.overlap.vs3op@aleeas.com> | 2022-12-15 15:35:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-15 16:35:25 +0100 |
commit | c50e9d078aa3c353afc140669f1cedcd354ee53e (patch) | |
tree | 2f0b24370f87f8eee6bd103cbaad1610de7ca457 /app/views/admin | |
parent | f0cebaee00f80270bef7a7ce8e03597dd118ad23 (diff) |
Render current day formats in the client timezone (#21878)
* Fix remaining plain %time to %time.formatted * Add %time.relative-formatted to client format dates on the current day * Add missing comma dangle to formats * Use client side message format instead of the server * Add fallback message to relatve_format.today * Remove unused translation key and fix js lint issue Co-authored-by: Effy Elden <effy@effy.space>
Diffstat (limited to 'app/views/admin')
-rw-r--r-- | app/views/admin/report_notes/_report_note.html.haml | 7 | ||||
-rw-r--r-- | app/views/admin/reports/show.html.haml | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/app/views/admin/report_notes/_report_note.html.haml b/app/views/admin/report_notes/_report_note.html.haml index 3bccd3b4b..14df2f609 100644 --- a/app/views/admin/report_notes/_report_note.html.haml +++ b/app/views/admin/report_notes/_report_note.html.haml @@ -4,11 +4,8 @@ .report-notes__item__header %span.username = link_to report_note.account.username, admin_account_path(report_note.account_id) - %time{ datetime: report_note.created_at.iso8601, title: l(report_note.created_at) } - - if report_note.created_at.today? - = t('admin.report_notes.today_at', time: l(report_note.created_at, format: :time)) - - else - = l report_note.created_at.to_date + %time.relative-formatted{ datetime: report_note.created_at } + = t('admin.report_notes.created_at') .report-notes__item__content = simple_format(h(report_note.content)) diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml index cf960565f..50ec64b06 100644 --- a/app/views/admin/reports/show.html.haml +++ b/app/views/admin/reports/show.html.haml @@ -144,11 +144,8 @@ = link_to @report.account.username, admin_account_path(@report.account_id) - else = link_to @report.account.domain, admin_instance_path(@report.account.domain) - %time{ datetime: @report.created_at.iso8601, title: l(@report.created_at) } - - if @report.created_at.today? - = t('admin.report_notes.today_at', time: l(@report.created_at, format: :time)) - - else - = l @report.created_at.to_date + %time.relative-formatted{ datetime: @report.created_at.iso8601 } + = t('admin.report_notes.created_at') .report-notes__item__content = simple_format(h(@report.comment)) |