diff --git a/roundup/date.py b/roundup/date.py
index 372ddb2b4f0827ec5b16bec829dec45ad2d5e042..db4f66ea7d5e83d4532ed43bb206f3f667032dd3 100644 (file)
--- a/roundup/date.py
+++ b/roundup/date.py
-# $Id: date.py,v 1.6 2001-07-31 09:54:18 richard Exp $
+# $Id: date.py,v 1.7 2001-08-02 00:27:04 richard Exp $
import time, re, calendar
< 1 day
otherwise, return None (so a full date may be displayed)
'''
- if self.year or self.month or self.day > 5:
+ if self.year or self.month > 2:
return None
+ if self.month:
+ days = (self.month * 30) + self.day
+ if days > 28:
+ return '%s months'%int(days/30)
+ else:
+ return '%s weeks'%int(days/7)
+ if self.day > 7:
+ return '%s weeks'%self.day
if self.day > 1:
return '%s days'%self.day
if self.day == 1 or self.hour > 12:
return '1 minute'
if self.minute < 15:
return '%s minutes'%self.minute
- quart = self.minute/15
+ quart = int(self.minute/15)
if quart == 2:
return '1/2 an hour'
return '%s/4 hour'%quart
#
# $Log: not supported by cvs2svn $
+# Revision 1.6 2001/07/31 09:54:18 richard
+# Fixed the 2.1-specific gmtime() (no arg) call in roundup.date. (Paul Wright)
+#
# Revision 1.5 2001/07/29 07:01:39 richard
# Added vim command to all source so that we don't get no steenkin' tabs :)
#