X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=roundup%2Fdate.py;h=ef65d87f86fb7c1c099777fc8910f11f13094d26;hb=539767b70b0d7fc4553c0037cb3f551bb0c6b1ee;hp=fac763db6dd9aba6f9d35809bb143860c8a3d0a1;hpb=f8321089b2a445b0ee36ade9b6e65924073eff6b;p=roundup.git diff --git a/roundup/date.py b/roundup/date.py index fac763d..ef65d87 100644 --- a/roundup/date.py +++ b/roundup/date.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: date.py,v 1.11 2001-08-15 23:43:18 richard Exp $ +# $Id: date.py,v 1.13 2001-09-18 22:58:37 richard Exp $ import time, re, calendar @@ -317,14 +317,17 @@ class Interval: ''' if self.year or self.month > 2: return None - if self.month: + if self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: - return '%s months'%int(days/30) + if int(days/30) > 1: + return '%s months'%int(days/30) + else: + return '1 month' else: return '%s weeks'%int(days/7) if self.day > 7: - return '%s weeks'%self.day + return '1 week' if self.day > 1: return '%s days'%self.day if self.day == 1 or self.hour > 12: @@ -376,6 +379,13 @@ if __name__ == '__main__': # # $Log: not supported by cvs2svn $ +# Revision 1.12 2001/08/17 03:08:11 richard +# fixed prettification of intervals of 1 week +# +# Revision 1.11 2001/08/15 23:43:18 richard +# Fixed some isFooTypes that I missed. +# Refactored some code in the CGI code. +# # Revision 1.10 2001/08/07 00:24:42 richard # stupid typo #