Include time portion in formatted datetimes when provided

This commit is contained in:
Emelia Smith 2024-12-05 18:53:17 +01:00
parent d29eddc401
commit ee30f64764
No known key found for this signature in database
4 changed files with 8 additions and 4 deletions

View file

@ -119,7 +119,11 @@ function loaded() {
formattedContent = dateFormat.format(datetime);
}
content.title = formattedContent;
const timeGiven = content.dateTime.includes('T');
content.title = timeGiven
? dateTimeFormat.format(datetime)
: dateFormat.format(datetime);
content.textContent = formattedContent;
});

View file

@ -4,7 +4,7 @@
.report-notes__item__header
%span.username
= link_to report_note.account.username, admin_account_path(report_note.account_id)
%time.relative-formatted{ datetime: report_note.created_at.iso8601 }
%time.relative-formatted{ datetime: report_note.created_at.iso8601, title: report_note.created_at }
= l report_note.created_at.to_date
.report-notes__item__content

View file

@ -18,7 +18,7 @@
= link_to report.account.username, admin_account_path(report.account_id)
- else
= link_to report.account.domain, admin_instance_path(report.account.domain)
%time.relative-formatted{ datetime: report.created_at.iso8601 }
%time.relative-formatted{ datetime: report.created_at.iso8601, title: report.created_at }
= l report.created_at.to_date
.report-notes__item__content
= simple_format(h(report.comment))

View file

@ -66,7 +66,7 @@
.report-notes__item__header
%span.username
= link_to @appeal.account.username, can?(:show, @appeal.account) ? admin_account_path(@appeal.account_id) : short_account_url(@appeal.account)
%time.relative-formatted{ datetime: @appeal.created_at.iso8601 }
%time.relative-formatted{ datetime: @appeal.created_at.iso8601, title: @appeal.created_at }
= l @appeal.created_at.to_date
.report-notes__item__content