diff --git a/roundup/date.py b/roundup/date.py
index 54265d170431c02edbb610749a3487a55f3e6515..7073238f66424fa2a0db85c34117f806409640ce 100644 (file)
--- a/roundup/date.py
+++ b/roundup/date.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: date.py,v 1.36 2002-10-12 23:10:36 richard Exp $
+# $Id: date.py,v 1.41 2003-02-07 01:01:25 richard Exp $
__doc__ = """
Date, time and time interval handling.
info = m.groupdict()
- # get the current date/time using the offset
+ # get the current date as our default
y,m,d,H,M,S,x,x,x = time.gmtime(time.time())
# override year, month, day parts
if info['m'] is not None and info['d'] is not None:
m = int(info['m'])
d = int(info['d'])
- if info['y'] is not None: y = int(info['y'])
+ if info['y'] is not None:
+ y = int(info['y'])
+ # time defaults to 00:00:00 now
H = M = S = 0
# override hour, minute, second parts
return '<Date %s>'%self.__str__()
def local(self, offset):
- """Return this date as yyyy-mm-dd.hh:mm:ss in a local time zone."""
- t = (self.year, self.month, self.day, self.hour + offset, self.minute,
- self.second, 0, 0, 0)
- self.year, self.month, self.day, self.hour, self.minute, \
- self.second, x, x, x = time.gmtime(calendar.timegm(t))
+ """ Return this date as yyyy-mm-dd.hh:mm:ss in a local time zone.
+ """
+ return Date((self.year, self.month, self.day, self.hour + offset,
+ self.minute, self.second, 0, 0, 0))
def get_tuple(self):
return (self.year, self.month, self.day, self.hour, self.minute,
s = _('1/2 an hour')
else:
s = _('%(number)s/4 hour')%{'number': int(self.minute/15)}
+ if self.sign < 0:
+ s = s + _(' ago')
return s
def get_tuple(self):