After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732611 - chatview: fix timestamp formatting
chatview: fix timestamp formatting
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-02 09:41 UTC by Giovanni Campagna
Modified: 2014-07-02 15:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
chatview: fix timestamp formatting (1.80 KB, patch)
2014-07-02 09:41 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2014-07-02 09:41:24 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.
Comment 1 Giovanni Campagna 2014-07-02 09:41:27 UTC
Created attachment 279740 [details] [review]
chatview: fix timestamp formatting
Comment 2 Florian Müllner 2014-07-02 13:59:46 UTC
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?
Comment 3 Giovanni Campagna 2014-07-02 14:00:55 UTC
(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...
Comment 4 Giovanni Campagna 2014-07-02 15:21:55 UTC
Pushed with the suggested fix.

Attachment 279740 [details] pushed as e483304 - chatview: fix timestamp formatting