recent_topics: Show exact date-time on last msg time hover.

This commit is contained in:
Aman Agrawal
2020-06-26 15:55:35 +05:30
committed by Tim Abbott
parent b0c4dd2c98
commit 7e16650de1
3 changed files with 10 additions and 1 deletions

View File

@@ -42,6 +42,12 @@ set_global('timerender', {
last_seen_status_from_date: () => {
return "Just now";
},
get_full_datetime: () => {
return {
date: "date",
time: "time",
};
},
});
set_global('unread', {
unread_topic_counter: {
@@ -270,6 +276,7 @@ function generate_topic_data(topic_info_array) {
invite_only: false,
is_web_public: true,
last_msg_time: 'Just now',
full_last_msg_date_time: "date time",
senders: [
1,
2,

View File

@@ -157,6 +157,7 @@ function format_topic(topic_data) {
const topic = last_msg.topic;
const time = new XDate(last_msg.timestamp * 1000);
const last_msg_time = timerender.last_seen_status_from_date(time);
const full_datetime = timerender.get_full_datetime(time);
// We hide the row according to filters or if it's muted.
// We only supply the data to the topic rows and let jquery
@@ -191,6 +192,7 @@ function format_topic(topic_data) {
muted: muted,
topic_muted: topic_muted,
participated: topic_data.participated,
full_last_msg_date_time: full_datetime.date + ' ' + full_datetime.time,
};
}

View File

@@ -39,7 +39,7 @@
{{/each}}
</ul>
</td>
<td class="recent_topic_timestamp">
<td class="recent_topic_timestamp" title="{{this.full_last_msg_date_time}}">
{{ last_msg_time }}
</td>
</tr>