From: richard Date: Wed, 15 May 2002 06:32:46 +0000 (+0000) Subject: . reverting to dates for intervals > 2 months sucks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=091faaf188a24b032a8a274d8bb84766e529812b;p=roundup.git . reverting to dates for intervals > 2 months sucks git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@733 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index bf0b32b..5a42844 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -27,6 +27,7 @@ Feature: ADD_RECIPIENTS_TO_NOSY (default 'new'). These settings emulate the current behaviour. Setting them to 'yes' will add the author/recipients to the nosy on messages that create issues and followup messages. + . reverting to dates for intervals > 2 months sucks Fixed: . stop sending blank (whitespace-only) notes diff --git a/roundup/date.py b/roundup/date.py index c170fb6..c40c4dc 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.20 2002-02-21 23:34:51 richard Exp $ +# $Id: date.py,v 1.21 2002-05-15 06:32:46 richard Exp $ __doc__ = """ Date, time and time interval handling. @@ -366,8 +366,11 @@ class Interval: def pretty(self): ''' print up the date date using one of these nice formats.. ''' - if self.year or self.month > 2: - return None + if self.year: + if self.year == 1: + return _('1 year') + else: + return _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: @@ -437,6 +440,10 @@ if __name__ == '__main__': # # $Log: not supported by cvs2svn $ +# Revision 1.20 2002/02/21 23:34:51 richard +# Oops, there's 24 hours in a day, and subtraction of intervals now works +# properly. +# # Revision 1.19 2002/02/21 23:11:45 richard # . fixed some problems in date calculations (calendar.py doesn't handle over- # and under-flow). Also, hour/minute/second intervals may now be more than