Skip to content

Commit ee7e0c4

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 777d598 commit ee7e0c4

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Fixed:
88
- HTML templating isset() inverted (sf bug 951779)
99
- otks manager missing (sf bug 952931)
1010
- mention DEFAULT_TIMEZONE requirement in upgrading doc (sf bug 952932)
11+
- fix DateHTMLProperty so local() can override user timezone (sf bug
12+
953678)
1113

1214

1315
2004-05-07 0.7.1

doc/index.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ John P. Rouillard,
115115
Ollie Rutherfurd,
116116
Toby Sargeant,
117117
Florian Schulze,
118+
Klamer Schutte,
118119
Dougal Scott,
119120
Stefan Seefeld,
120121
Jeffrey P Shell,
121-
Klamer Schutte,
122122
Joel Shprentz,
123123
Terrel Shumway,
124+
Emil Sit,
124125
Nathaniel Smith,
125126
Mike Thompson,
126127
Darryl VanDorp,

roundup/cgi/templating.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ def submit(self, label="Submit Changes"):
671671
Also sneak in the lastactivity and action hidden elements.
672672
"""
673673
return self.input(type="hidden", name="@lastactivity",
674-
value=self.activity) + '\n' + \
674+
value=self.activity.local(0)) + '\n' + \
675675
self.input(type="hidden", name="@action", value="edit") + '\n' + \
676676
self.input(type="submit", name="submit", value=label)
677677

@@ -1269,14 +1269,24 @@ def field(self):
12691269
return s
12701270

12711271
class DateHTMLProperty(HTMLProperty):
1272+
def __init__(self, client, classname, nodeid, prop, name, value,
1273+
anonymous=0, offset=None):
1274+
HTMLProperty.__init__(self, client, classname, nodeid, prop, name,
1275+
value, anonymous=anonymous)
1276+
self._offset = offset
1277+
12721278
def plain(self):
12731279
''' Render a "plain" representation of the property
12741280
'''
12751281
self.view_check()
12761282

12771283
if self._value is None:
12781284
return ''
1279-
return str(self._value.local(self._db.getUserTimezone()))
1285+
if self._offset is None:
1286+
offset = self._db.getUserTimezone()
1287+
else:
1288+
offset = self._offset
1289+
return str(self._value.local(offset))
12801290

12811291
def now(self):
12821292
''' Return the current time.
@@ -1346,7 +1356,7 @@ def local(self, offset):
13461356
self.view_check()
13471357

13481358
return DateHTMLProperty(self._client, self._classname, self._nodeid,
1349-
self._prop, self._formname, self._value.local(offset))
1359+
self._prop, self._formname, self._value, offset=offset)
13501360

13511361
class IntervalHTMLProperty(HTMLProperty):
13521362
def plain(self):

0 commit comments

Comments
 (0)