comparison roundup/date.py @ 1412:e5fb7d4bf251

add "ago" to intervals in the past [SF#679232]
author Richard Jones <richard@users.sourceforge.net>
date Fri, 07 Feb 2003 01:01:25 +0000
parents fe18877acc56
children 4ae9d725bec4
comparison
equal deleted inserted replaced
1411:b84821c9f966 1412:e5fb7d4bf251
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: date.py,v 1.40 2002-12-18 00:15:53 richard Exp $ 18 # $Id: date.py,v 1.41 2003-02-07 01:01:25 richard Exp $
19 19
20 __doc__ = """ 20 __doc__ = """
21 Date, time and time interval handling. 21 Date, time and time interval handling.
22 """ 22 """
23 23
459 s = _('%(number)s minutes')%{'number': self.minute} 459 s = _('%(number)s minutes')%{'number': self.minute}
460 elif int(self.minute/15) == 2: 460 elif int(self.minute/15) == 2:
461 s = _('1/2 an hour') 461 s = _('1/2 an hour')
462 else: 462 else:
463 s = _('%(number)s/4 hour')%{'number': int(self.minute/15)} 463 s = _('%(number)s/4 hour')%{'number': int(self.minute/15)}
464 if self.sign < 0:
465 s = s + _(' ago')
464 return s 466 return s
465 467
466 def get_tuple(self): 468 def get_tuple(self):
467 return (self.sign, self.year, self.month, self.day, self.hour, 469 return (self.sign, self.year, self.month, self.day, self.hour,
468 self.minute, self.second) 470 self.minute, self.second)

Roundup Issue Tracker: http://roundup-tracker.org/