From 92940179f663af380c011a1df0bacbae2de56719 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 16 Dec 2002 04:39:36 +0000 Subject: [PATCH] always default time to 00:00:00 git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1412 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 1 + doc/index.txt | 1 + roundup/date.py | 13 ++++++++----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 28cc97e..591e41a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,7 @@ are given with the most recent entry first. - key the templates cache off full path, not filename - implemented whole-database locking - hyperlinking of special text (url, email, item designator) in messages +- fixed time default in date.py 2002-12-11 0.5.3 diff --git a/doc/index.txt b/doc/index.txt index cae0ab8..0e707c0 100644 --- a/doc/index.txt +++ b/doc/index.txt @@ -77,6 +77,7 @@ Gordon McMillan, Patrick Ohly, Will Partain, Bernhard Reiter, +John P. Rouillard, Dougal Scott, Stefan Seefeld, Jeffrey P Shell, diff --git a/roundup/date.py b/roundup/date.py index aee9acd..d98e586 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.37 2002-12-09 02:43:21 richard Exp $ +# $Id: date.py,v 1.38 2002-12-16 04:39:36 richard Exp $ __doc__ = """ Date, time and time interval handling. @@ -244,15 +244,18 @@ class Date: info = m.groupdict() - # get the current date/time using the offset - y,m,d,H,M,S,x,x,x = time.gmtime(time.time()) + # get the current date as our default + y,m,d = time.gmtime(time.time())[:3] + + # time defaults to 00:00:00 _always_ + H = M = S = 0 # 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']) - H = M = S = 0 + if info['y'] is not None: + y = int(info['y']) # override hour, minute, second parts if info['H'] is not None and info['M'] is not None: -- 2.30.2