[gitg] Do not show date in commit dialog when it is now



commit 3b1cf73e4aa712c4fa96fc7300f69b2f0f4253ff
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sat Jul 6 21:50:03 2013 +0200

    Do not show date in commit dialog when it is now

 gitg/commit/gitg-commit-dialog.vala |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gitg/commit/gitg-commit-dialog.vala b/gitg/commit/gitg-commit-dialog.vala
index ae73a5e..d0270e7 100644
--- a/gitg/commit/gitg-commit-dialog.vala
+++ b/gitg/commit/gitg-commit-dialog.vala
@@ -119,7 +119,18 @@ class Dialog : Gtk.Dialog
                var email = d_author.get_email();
 
                d_label_user.set_label(@"$name <$email>");
-               d_label_date.set_label((new Gitg.Date.for_date_time(d_author.get_time())).for_display());
+
+               var t = d_author.get_time();
+               var now = new DateTime.now_local();
+
+               if (now.difference(t) < TimeSpan.SECOND * 5)
+               {
+                       d_label_date.set_label("");
+               }
+               else
+               {
+                       d_label_date.set_label((new Gitg.Date.for_date_time(t)).for_display());
+               }
 
                var ac = Gitg.AvatarCache.default();
                d_cancel_avatar = new Cancellable();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]