Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
59d8d375
Commit
59d8d375
authored
Jun 08, 2003
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #928: DateIndex ignored timezones when indexing and
querying
parent
097d0a30
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
+6
-3
lib/python/Products/PluginIndexes/DateIndex/tests/test_DateIndex.py
.../Products/PluginIndexes/DateIndex/tests/test_DateIndex.py
+1
-1
No files found.
doc/CHANGES.txt
View file @
59d8d375
...
...
@@ -57,6 +57,9 @@ Zope Changes
Bugs Fixed
- Collector #928: DateIndex ignored timezones when indexing and
querying
- Collector #892: misleading error msg when initializing an OIBTree
from a dict with a float value. The message claimed that the
dict's items didn't consist of 2-element tuples, but of course
...
...
lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
View file @
59d8d375
...
...
@@ -11,7 +11,8 @@
#
##############################################################################
"""$Id: DateIndex.py,v 1.10 2003/01/23 17:46:19 andreasjung Exp $ """
"""$Id: DateIndex.py,v 1.11 2003/06/08 08:56:28 andreasjung Exp $
"""
from
DateTime.DateTime
import
DateTime
from
Products.PluginIndexes
import
PluggableIndex
...
...
@@ -168,12 +169,14 @@ class DateIndex(UnIndex):
def
_convert
(
self
,
value
,
default
=
None
):
"""Convert Date/Time value to our internal representation"""
# XXX: Code patched 20/May/2003 by Kiran Jonnalagadda to
# convert dates to UTC first.
if
isinstance
(
value
,
DateTime
):
t_tup
=
value
.
parts
()
t_tup
=
value
.
toZone
(
'UTC'
).
parts
()
elif
type
(
value
)
in
(
FloatType
,
IntType
):
t_tup
=
time
.
gmtime
(
value
)
elif
type
(
value
)
is
StringType
:
t_obj
=
DateTime
(
value
)
t_obj
=
DateTime
(
value
)
.
toZone
(
'UTC'
)
t_tup
=
t_obj
.
parts
()
else
:
return
default
...
...
lib/python/Products/PluginIndexes/DateIndex/tests/test_DateIndex.py
View file @
59d8d375
...
...
@@ -80,7 +80,7 @@ class DI_Tests(unittest.TestCase):
if
type
(
date
)
in
(
FloatType
,
IntType
):
yr
,
mo
,
dy
,
hr
,
mn
=
time
.
gmtime
(
date
)[:
5
]
else
:
yr
,
mo
,
dy
,
hr
,
mn
=
date
.
parts
()[:
5
]
yr
,
mo
,
dy
,
hr
,
mn
=
date
.
toZone
(
'UTC'
).
parts
()[:
5
]
return
(((
yr
*
12
+
mo
)
*
31
+
dy
)
*
24
+
hr
)
*
60
+
mn
def
test_empty
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment