diff options
| author | Pratyush Desai | 2021-07-14 05:48:16 +0530 |
|---|---|---|
| committer | Pratyush Desai | 2021-07-14 05:48:16 +0530 |
| commit | bf8d05542451af87176100d64ad0052b5f325898 (patch) | |
| tree | bc226bd66bb61d4d6f2514ac8bda7fc31dfc213c | |
| parent | bdc110598ca47ebd2013533ee25df1086140d6ec (diff) | |
| download | tripsit-bf8d05542451af87176100d64ad0052b5f325898.tar.gz tripsit-bf8d05542451af87176100d64ad0052b5f325898.tar.bz2 tripsit-bf8d05542451af87176100d64ad0052b5f325898.zip | |
fix time formattingtimeformatting
| -rw-r--r-- | plugin.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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: |
