mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: improve topic timeline date titles (#27351)
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
<a
|
||||
class="start-date"
|
||||
onClick={{this.updatePercentage}}
|
||||
title={{this.startDate}}
|
||||
title={{i18n "topic_entrance.sr_jump_top_button"}}
|
||||
>
|
||||
<span>
|
||||
{{this.startDate}}
|
||||
|
||||
@@ -193,6 +193,7 @@ export default class TopicTimelineScrollArea extends Component {
|
||||
|
||||
get nowDateOptions() {
|
||||
return {
|
||||
customTitle: I18n.t("topic_entrance.sr_jump_bottom_button"),
|
||||
addAgo: true,
|
||||
defaultFormat: timelineDate,
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ registerRawHelper("age-with-tooltip", ageWithTooltip);
|
||||
export default function ageWithTooltip(dt, params = {}) {
|
||||
return htmlSafe(
|
||||
autoUpdatingRelativeAge(new Date(dt), {
|
||||
customTitle: params.customTitle,
|
||||
title: true,
|
||||
addAgo: params.addAgo || false,
|
||||
...(params.defaultFormat && { defaultFormat: params.defaultFormat }),
|
||||
|
||||
@@ -98,7 +98,9 @@ export function autoUpdatingRelativeAge(date, options) {
|
||||
append += " with-year";
|
||||
}
|
||||
|
||||
if (options.title) {
|
||||
if (options.customTitle) {
|
||||
append += "' title='" + options.customTitle;
|
||||
} else if (options.title) {
|
||||
append += "' title='" + longDate(date);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user