GNOME Bugzilla – Bug 732611
chatview: fix timestamp formatting
Last modified: 2014-07-02 15:21:59 UTC
We want to show "yesterday" when the day part of the date is different, even if less than 24 hours have passed. To do so, instead of computing the difference between the actual time points, use two reference points (located at 00:01) in the same day, that thus will be always different by an integer number of days.
Created attachment 279740 [details] [review] chatview: fix timestamp formatting
Review of attachment 279740 [details] [review]: ::: src/chatView.js @@ +560,3 @@ let now = GLib.DateTime.new_now_local(); + // 00:01 actually, just to be safe 00:00:01, no? @@ +564,3 @@ + now.get_month(), + now.get_day_of_month(), + 0, 0, 1, 0); g_date_time_new_local() has just six parameters, no? Where does the last 0 come from?
(In reply to comment #2) > Review of attachment 279740 [details] [review]: > > ::: src/chatView.js > @@ +560,3 @@ > let now = GLib.DateTime.new_now_local(); > > + // 00:01 actually, just to be safe > > 00:00:01, no? > > @@ +564,3 @@ > + now.get_month(), > + now.get_day_of_month(), > + 0, 0, 1, 0); > > g_date_time_new_local() has just six parameters, no? Where does the last 0 come > from? It was meant to be 00:01:00, but apparently I got that wrong...
Pushed with the suggested fix. Attachment 279740 [details] pushed as e483304 - chatview: fix timestamp formatting