Skip to content

Commit 082874a

Browse files
author
Andrey Lebedev
committed
If no hours info is provided to Date constructors...
...it defaults to local midnight, not GMT [SF#691434] fix in history displaying of date fields changes
1 parent f0f0294 commit 082874a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

roundup/cgi/templating.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,6 @@ def history(self, direction='descending', dre=re.compile('\d+')):
661661
d = date.Date(args[k]).local(timezone)
662662
cell.append('%s: %s'%(k, str(d)))
663663
if current.has_key(k):
664-
if not current[k] == '(no value)' and current[k]:
665-
current[k] = date.Date(current[k]).local(timezone)
666664
cell[-1] += ' -> %s' % current[k]
667665
current[k] = str(d)
668666

roundup/date.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: date.py,v 1.42 2003-02-07 02:33:34 richard Exp $
18+
# $Id: date.py,v 1.43 2003-02-23 19:05:14 kedder Exp $
1919

2020
__doc__ = """
2121
Date, time and time interval handling.
@@ -253,8 +253,9 @@ def set(self, spec, offset=0, date_re=re.compile(r'''
253253
d = int(info['d'])
254254
if info['y'] is not None:
255255
y = int(info['y'])
256-
# time defaults to 00:00:00 now
257-
H = M = S = 0
256+
# time defaults to 00:00:00 GMT - offset (local midnight)
257+
H = -offset
258+
M = S = 0
258259

259260
# override hour, minute, second parts
260261
if info['H'] is not None and info['M'] is not None:

0 commit comments

Comments
 (0)