summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPratyush Desai2021-07-14 05:48:16 +0530
committerPratyush Desai2021-07-14 05:48:16 +0530
commitbf8d05542451af87176100d64ad0052b5f325898 (patch)
treebc226bd66bb61d4d6f2514ac8bda7fc31dfc213c
parentbdc110598ca47ebd2013533ee25df1086140d6ec (diff)
downloadtripsit-timeformatting.tar.gz
tripsit-timeformatting.tar.bz2
tripsit-timeformatting.zip
fix time formattingtimeformatting
-rw-r--r--plugin.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugin.py b/plugin.py
index a451675..68dc78f 100644
--- a/plugin.py
+++ b/plugin.py
@@ -248,11 +248,11 @@ class Tripsit(callbacks.Plugin):
self.db[nick] = {'timezone': timezone, 'doses': doses}
if dose_td == 0:
- re = utils.str.format("You dosed %s of %s at %s, %s", dose, drug_and_method, str(time), timezone)
+ re = utils.str.format("You dosed %s of %s at %s, %s", dose, drug_and_method, time.strftime("%c"), timezone)
if onset is not None:
re += utils.str.format(". You should start feeling effects %s from now", onset)
else:
- re = utils.str.format("You dosed %s of %s at %s, %s ; %T ago", dose, drug_and_method, str(time), timezone, dose_td.total_seconds())
+ re = utils.str.format("You dosed %s of %s at %s, %s ; %T ago", dose, drug_and_method, time.strftime("%c"), timezone, dose_td.total_seconds())
if onset is not None:
re += utils.str.format(". You should have/will start feeling effects %s from/after dosing", onset)
irc.reply(re)
@@ -292,7 +292,9 @@ class Tripsit(callbacks.Plugin):
if nick in self.db:
try:
nick_dose_log_count = len(self.db[nick]['doses'])
- irc.reply(f"{nick} has logged {nick_dose_log_count} doses")
+ nick_dose_log_since = self.db[nick]['doses'][0]["time"]
+ nick_dose_log_since_string = nick_dose_log_since.strftime("%c")
+ irc.reply(f"{nick} has logged {nick_dose_log_count} doses since {nick_dose_log_since_string}")
except IndexError:
irc.error(f"Can't seem to do math, check logs")
else: