1.1 --- a/DateSupport.py Wed May 01 15:48:18 2013 +0200
1.2 +++ b/DateSupport.py Fri May 03 00:12:57 2013 +0200
1.3 @@ -92,9 +92,7 @@
1.4 as the earliest time in a particular day.
1.5 """
1.6
1.7 - are_equal = a == b
1.8 -
1.9 - if are_equal:
1.10 + if a == b:
1.11 a2 = a.as_datetime_or_date()
1.12 b2 = b.as_datetime_or_date()
1.13
1.14 @@ -746,20 +744,21 @@
1.15 if isinstance(other, ActsAsTimespan):
1.16 other = other.as_timespan()
1.17
1.18 - if self.end is not None and other.start is not None and self.is_before(self.end, other.start):
1.19 - return -1
1.20 - elif self.start is not None and other.end is not None and self.is_before(other.end, self.start):
1.21 - return 1
1.22 - else:
1.23 - return 0
1.24 + before = self.end is not None and other.start is not None and self.is_before(self.end, other.start)
1.25 + after = self.start is not None and other.end is not None and self.is_before(other.end, self.start)
1.26 + else:
1.27 + before = self.end is not None and self.is_before(self.end, other)
1.28 + after = self.start is not None and self.is_before(other, self.start)
1.29
1.30 + # Two identical points in time will be "before" each other according to
1.31 + # the is_before test.
1.32 +
1.33 + if not before and not after or before and after:
1.34 + return 0
1.35 + elif before:
1.36 + return -1
1.37 else:
1.38 - if self.end is not None and self.is_before(self.end, other):
1.39 - return -1
1.40 - elif self.start is not None and self.is_before(other, self.start):
1.41 - return 1
1.42 - else:
1.43 - return 0
1.44 + return 1
1.45
1.46 class TimespanCollection:
1.47
2.1 --- a/README.txt Wed May 01 15:48:18 2013 +0200
2.2 +++ b/README.txt Fri May 03 00:12:57 2013 +0200
2.3 @@ -72,6 +72,8 @@
2.4 * Introduced support for reverse iteration over stored items.
2.5 * Expanded the stored metadata for cached remote resources in
2.6 MoinRemoteSupport.
2.7 + * Changed DateSupport to permit identical timespan instants (whose start and
2.8 + end times are identical) to be recognised as such when compared.
2.9
2.10 New in MoinSupport 0.2 (Changes since MoinSupport 0.1)
2.11 ------------------------------------------------------