From 26c15e98977042e2efbb8deebf87a477176dba89 Mon Sep 17 00:00:00 2001 From: Michael Gratton Date: Wed, 13 Mar 2019 16:56:14 +1100 Subject: [PATCH] Ensure email dates are displayed to in the local time zone --- .../conversation-list/formatted-conversation-data.vala | 6 ++++-- src/client/conversation-viewer/conversation-email.vala | 7 ++++++- src/client/conversation-viewer/conversation-message.vala | 5 +++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/client/conversation-list/formatted-conversation-data.vala b/src/client/conversation-list/formatted-conversation-data.vala index 1fc4c80a..16cca0cd 100644 --- a/src/client/conversation-list/formatted-conversation-data.vala +++ b/src/client/conversation-list/formatted-conversation-data.vala @@ -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; diff --git a/src/client/conversation-viewer/conversation-email.vala b/src/client/conversation-viewer/conversation-email.vala index d02d7bf2..58d1a980 100644 --- a/src/client/conversation-viewer/conversation-email.vala +++ b/src/client/conversation-viewer/conversation-email.vala @@ -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 diff --git a/src/client/conversation-viewer/conversation-message.vala b/src/client/conversation-viewer/conversation-message.vala index 9331263f..945c2cea 100644 --- a/src/client/conversation-viewer/conversation-message.vala +++ b/src/client/conversation-viewer/conversation-message.vala @@ -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);