aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2019-07-13 18:33:51 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2019-07-13 18:33:51 +0200
commit3096d749d7cc826cbe814f85bef08bdb419a28c7 (patch)
treec7984b857aad929a55f5b10efa9a6cf2c0bff3dc
parent3e3eff9ee639a60052a3fb4ae2e6955d2f85ae92 (diff)
Print a gregorian date for days different from today.HEADmaster
-rwxr-xr-xdebdate10
1 files changed, 7 insertions, 3 deletions
diff --git a/debdate b/debdate
index ed9542f..f92d371 100755
--- a/debdate
+++ b/debdate
@@ -35,9 +35,9 @@ RELEASES = [
(datetime.date(1996, 12, 12), 'rex'),
(datetime.date(1996, 6, 17), 'buzz'),
]
-MSG = "Today is day {dody} of year {yodr} of the {release}"
-FUTURE_MSG = "Today could be day {dody} of year {yodr} of the {release}"
-ERR_MSG = "Today is {isodate} of the Debianless Age"
+MSG = "{today} is day {dody} of year {yodr} of the {release}"
+FUTURE_MSG = "{today} could be day {dody} of year {yodr} of the {release}"
+ERR_MSG = "{isodate} is in the Debianless Age"
class DebDate:
@@ -80,6 +80,10 @@ class DebDate:
data['certain'] = math.exp((today - day).days / 365.25 )
else:
data['certain'] = 1
+ if day == today:
+ data['today'] = 'Today'
+ else:
+ data['today'] = day.isoformat()
for r in self.releases:
epoch = r[0]
data['release'] = r[1]