Ensure email dates are displayed to in the local time zone

This commit is contained in:
Michael Gratton 2019-03-13 16:56:14 +11:00 committed by Michael James Gratton
parent 9c115bec38
commit 26c15e9897
3 changed files with 13 additions and 5 deletions

View file

@ -129,8 +129,10 @@ public class FormattedConversationData : Geary.BaseObject {
// conversation list store sorts by date-received, so display that instead of sender's
// Date:
string new_date = Util.Date.pretty_print(latest.properties.date_received,
GearyApplication.instance.config.clock_format);
string new_date = Util.Date.pretty_print(
latest.properties.date_received.to_local(),
GearyApplication.instance.config.clock_format
);
if (new_date == date)
return false;

View file

@ -995,7 +995,12 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
if (this.email.date != null) {
// Translators: Human-readable version of the RFC 822 Date header
builder.set_member_name(_("Date:"));
builder.add_string_value(this.email.date.to_string());
builder.add_string_value(
Util.Date.pretty_print_verbose(
this.email.date.value.to_local(),
this.config.clock_format
)
);
}
if (this.email.subject != null) {
// Translators: Human-readable version of the RFC 822 Subject header

View file

@ -399,11 +399,12 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
string date_text = "";
string date_tooltip = "";
if (date != null) {
GLib.DateTime local_date = date.value.to_local();
date_text = Util.Date.pretty_print(
date.value, config.clock_format
local_date, config.clock_format
);
date_tooltip = Util.Date.pretty_print_verbose(
date.value, config.clock_format
local_date, config.clock_format
);
}
this.compact_date.set_text(date_text);