mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
Show local time of user in user_popover.
This commit is contained in:
@@ -180,6 +180,16 @@ exports.reply_to_to_user_ids_string = function (emails_string) {
|
||||
return user_ids.join(',');
|
||||
};
|
||||
|
||||
exports.get_user_time = function (user_id) {
|
||||
var user_timezone = people.get_person_from_user_id(user_id).timezone;
|
||||
if (user_timezone) {
|
||||
if (page_params.twenty_four_hour_time) {
|
||||
return moment().tz(user_timezone).format("HH:mm");
|
||||
}
|
||||
return moment().tz(user_timezone).format("hh:mm A");
|
||||
}
|
||||
};
|
||||
|
||||
exports.emails_strings_to_user_ids_string = function (emails_string) {
|
||||
var emails = emails_string.split(',');
|
||||
return exports.email_list_to_user_ids_string(emails);
|
||||
|
||||
@@ -74,6 +74,7 @@ function show_message_info_popover(element, id) {
|
||||
user_full_name: message.sender_full_name,
|
||||
user_email: sender_email,
|
||||
user_id: message.sender_id,
|
||||
user_time: people.get_user_time(message.sender_id),
|
||||
pm_with_uri: narrow.pm_with_uri(sender_email),
|
||||
sent_by_uri: narrow.by_sender_uri(sender_email),
|
||||
narrowed: narrow.active(),
|
||||
@@ -82,7 +83,7 @@ function show_message_info_popover(element, id) {
|
||||
};
|
||||
|
||||
var ypos = elt.offset().top;
|
||||
var popover_size = 418;
|
||||
var popover_size = 428;
|
||||
var placement = "right";
|
||||
|
||||
if (!((ypos + (popover_size / 2) < message_viewport.height()) &&
|
||||
@@ -619,6 +620,7 @@ exports.register_click_handlers = function () {
|
||||
user_email: user_email,
|
||||
user_full_name: name,
|
||||
user_id: user_id,
|
||||
user_time: people.get_user_time(user_id),
|
||||
pm_with_uri: narrow.pm_with_uri(user_email),
|
||||
sent_by_uri: narrow.by_sender_uri(user_email),
|
||||
private_message_class: "compose_private_message",
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
<li><b>{{user_full_name}}</b></li>
|
||||
<li class='my_email'>{{user_email}}</li>
|
||||
|
||||
{{#if user_time}}
|
||||
<li>{{ user_time }} {{#tr this}}Local time{{/tr}}</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if historical}}
|
||||
<li class="small">({{t "Message sent when you were not subscribed" }})</li>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user