From 3b1cf73e4aa712c4fa96fc7300f69b2f0f4253ff Mon Sep 17 00:00:00 2001 From: Jesse van den Kieboom Date: Sat, 6 Jul 2013 21:50:03 +0200 Subject: [PATCH] Do not show date in commit dialog when it is now --- gitg/commit/gitg-commit-dialog.vala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gitg/commit/gitg-commit-dialog.vala b/gitg/commit/gitg-commit-dialog.vala index ae73a5e3..d0270e7e 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();