Added a == to match to check more exact matches
svn: r13717
This commit is contained in:
parent
22847e90ec
commit
0c10d47a90
@ -984,12 +984,16 @@ class Date(object):
|
|||||||
other_start, other_stop = other_date.get_start_stop_range()
|
other_start, other_stop = other_date.get_start_stop_range()
|
||||||
self_start, self_stop = self.get_start_stop_range()
|
self_start, self_stop = self.get_start_stop_range()
|
||||||
|
|
||||||
if comparison in ["=", "=="]:
|
if comparison == "=":
|
||||||
# If some overlap then match is True, otherwise False.
|
# If some overlap then match is True, otherwise False.
|
||||||
return ((self_start <= other_start <= self_stop) or
|
return ((self_start <= other_start <= self_stop) or
|
||||||
(self_start <= other_stop <= self_stop) or
|
(self_start <= other_stop <= self_stop) or
|
||||||
(other_start <= self_start <= other_stop) or
|
(other_start <= self_start <= other_stop) or
|
||||||
(other_start <= self_stop <= other_stop))
|
(other_start <= self_stop <= other_stop))
|
||||||
|
elif comparison == "==":
|
||||||
|
# If they match exactly on start and stop
|
||||||
|
return ((self_start == other_start) and
|
||||||
|
(other_stop == other_stop))
|
||||||
elif comparison == "<":
|
elif comparison == "<":
|
||||||
# If any < any
|
# If any < any
|
||||||
return self_start < other_stop
|
return self_start < other_stop
|
||||||
|
Loading…
Reference in New Issue
Block a user