Combine the actions popover with the timeinfo popover

The message timestamp is now always clickable, and the popover contains the
full long-form date and time.  This addresses one problem from usability
testing (see #470).

(imported from commit ad502dff128ad1c934fc0d3faaf5e2931c91c37e)
This commit is contained in:
Keegan McAllister
2013-02-08 21:29:40 -05:00
parent 520d7b1f97
commit 16d62fe5de
9 changed files with 55 additions and 41 deletions

View File

@@ -272,9 +272,15 @@ function add_display_time(message, prev) {
} else {
message.timestr = time.toString("HH:mm");
}
// Rather than using time.toLocaleString(), which varies by
// browser, just do our own hardcoded formatting.
message.full_date_str = time.toDateString() + " " + time.toTimeString();
// Convert to number of hours ahead/behind UTC.
// The sign of getTimezoneOffset() is reversed wrt
// the conventional meaning of UTC+n / UTC-n
var tz_offset = -time.getTimezoneOffset() / 60;
message.full_date_str = time.toLocaleDateString();
message.full_time_str = time.toLocaleTimeString() +
' (UTC' + ((tz_offset < 0) ? '' : '+') + tz_offset + ')';
}
function add_to_table(messages, table_name, filter_function, where, allow_collapse) {