Do not show date in commit dialog when it is now

This commit is contained in:
Jesse van den Kieboom 2013-07-06 21:50:03 +02:00
parent 69352ca413
commit 3b1cf73e4a

View file

@ -119,7 +119,18 @@ class Dialog : Gtk.Dialog
var email = d_author.get_email(); var email = d_author.get_email();
d_label_user.set_label(@"$name <$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(); var ac = Gitg.AvatarCache.default();
d_cancel_avatar = new Cancellable(); d_cancel_avatar = new Cancellable();