[gnome-clocks/wip/vala] Fix last day of the year
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks/wip/vala] Fix last day of the year
- Date: Mon, 18 Feb 2013 09:22:52 +0000 (UTC)
commit 71e9a994ae1ce4c48b40e3d425ef6bbfe4e3b317
Author: Paolo Borelli <pborelli gnome org>
Date: Mon Feb 18 10:15:51 2013 +0100
Fix last day of the year
src/world.vala | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/world.vala b/src/world.vala
index 74cd351..e489b99 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -75,11 +75,12 @@ private class Item : Object {
var d = date_time.get_day_of_year ();
var t = local_time.get_day_of_year ();
- // FIXME: last day of the year
if (d < t) {
- return _("Yesterday");
+ // If it is Dec 31st here and Jan 1st there (d = 1), then "tomorrow"
+ return d == 1 ? _("Tomorrow") : _("Yesterday");
} else if (d > t) {
- return _("Yesterday");
+ // If it is Jan 1st here and Dec 31st there (t = 1), then "yesterday"
+ return t == 1 ? _("Yesterday") : _("Tomorrow");
} else {
return null;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]