Skip to content

Commit 0e2b131

Browse files
author
Richard Jones
committed
date.Interval() now accepts an Interval as a spec [SF#1041266]
1 parent beb7c71 commit 0e2b131

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Fixed:
4545
- extend OTK and session table value cols to TEXT (sf bug 1031271)
4646
- fix lookup of REMOTE_USER (sf bug 1002923)
4747
- new Interval props weren't created properly in rdbms
48+
- date.Interval() now accepts an Interval as a spec (sf bug 1041266)
4849

4950

5051
2004-07-21 0.7.6

roundup/date.py

Lines changed: 4 additions & 1 deletion
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.75 2004-09-29 07:27:08 richard Exp $
18+
# $Id: date.py,v 1.76 2004-10-08 00:32:34 richard Exp $
1919

2020
"""Date, time and time interval handling.
2121
"""
@@ -476,6 +476,9 @@ def __init__(self, spec, sign=1, allowdate=1, add_granularity=0,
476476
self.from_seconds(spec)
477477
elif type(spec) in (StringType, UnicodeType):
478478
self.set(spec, allowdate=allowdate, add_granularity=add_granularity)
479+
elif isinstance(spec, Interval):
480+
(self.sign, self.year, self.month, self.day, self.hour,
481+
self.minute, self.second) = spec.get_tuple()
479482
else:
480483
if len(spec) == 7:
481484
self.sign, self.year, self.month, self.day, self.hour, \

0 commit comments

Comments
 (0)