UX: improve topic timeline date titles (#27351)
This commit is contained in:
parent
46ab4f0c4a
commit
dbd16776fa
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue