Friendly dates sometimes showing incorrect form
I just now received a message that Geary dated as Friday (i.e. tomorrow). It turns out some of my mail is in TZ +0000 and some -0700. When it's +0000, Geary wasn't converting into local time before displaying. The argument against doing this conversion in Imap.InternalDate is that it's holding as accurate a conversion as possible from the server's representation and the DateTime object, down to the timezone. Callers who intend to display the date should convert to local time before doing so.
This commit is contained in:
parent
b2ca184f40
commit
a52b3f4e2a
1 changed files with 3 additions and 2 deletions
|
|
@ -197,10 +197,11 @@ private string pretty_print_coarse(CoarseDate coarse_date, ClockFormat clock_for
|
|||
}
|
||||
|
||||
public string pretty_print(DateTime datetime, ClockFormat clock_format) {
|
||||
DateTime to_local = datetime.to_local();
|
||||
DateTime now = new DateTime.now_local();
|
||||
TimeSpan diff = now.difference(datetime);
|
||||
TimeSpan diff = now.difference(to_local);
|
||||
|
||||
return pretty_print_coarse(as_coarse_date(datetime, now, diff), clock_format, datetime, diff);
|
||||
return pretty_print_coarse(as_coarse_date(to_local, now, diff), clock_format, to_local, diff);
|
||||
}
|
||||
|
||||
public string pretty_print_verbose(DateTime datetime, ClockFormat clock_format) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue