diff options
author | Pacien TRAN-GIRARD | 2014-10-25 13:58:25 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2014-10-25 13:58:25 +0200 |
commit | 751dff374f14fe995d8864523be789420f71e02e (patch) | |
tree | 10636d01b84f136b8d47cb6d1dbfc82142e8178f /wikibania/ban | |
parent | 32497cb9f54f1a2783ca9334dc2b6432d8135fc4 (diff) | |
download | wikistats-751dff374f14fe995d8864523be789420f71e02e.tar.gz |
Properly calculate ban duration in months instead of days
Diffstat (limited to 'wikibania/ban')
-rw-r--r-- | wikibania/ban/Ban.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wikibania/ban/Ban.py b/wikibania/ban/Ban.py index e06ca89..c6a55b4 100644 --- a/wikibania/ban/Ban.py +++ b/wikibania/ban/Ban.py | |||
@@ -28,7 +28,7 @@ class Ban: | |||
28 | self.expiry = datetime.strptime(ban_dict["expiry"], ISO_TIMESTAMP) | 28 | self.expiry = datetime.strptime(ban_dict["expiry"], ISO_TIMESTAMP) |
29 | 29 | ||
30 | def calc_duration(self): | 30 | def calc_duration(self): |
31 | return (self.expiry - self.timestamp).days | 31 | return (self.expiry - self.timestamp).days / round(365 / 12) |
32 | 32 | ||
33 | def lookup_country_code(self): | 33 | def lookup_country_code(self): |
34 | try: | 34 | try: |