MCPcopy Create free account
hub / github.com/dateutil/dateutil / between

Method between

src/dateutil/rrule.py:271–302  ·  view source on GitHub ↗

Returns all the occurrences of the rrule between after and before. The inc keyword defines what happens if after and/or before are themselves occurrences. With inc=True, they will be included in the list, if they are found in the recurrence set.

(self, after, before, inc=False, count=1)

Source from the content-addressed store, hash-verified

269 yield d
270
271 def between(self, after, before, inc=False, count=1):
272 """ Returns all the occurrences of the rrule between after and before.
273 The inc keyword defines what happens if after and/or before are
274 themselves occurrences. With inc=True, they will be included in the
275 list, if they are found in the recurrence set. """
276 if self._cache_complete:
277 gen = self._cache
278 else:
279 gen = self
280 started = False
281 l = []
282 if inc:
283 for i in gen:
284 if i > before:
285 break
286 elif not started:
287 if i >= after:
288 started = True
289 l.append(i)
290 else:
291 l.append(i)
292 else:
293 for i in gen:
294 if i >= before:
295 break
296 elif not started:
297 if i > after:
298 started = True
299 l.append(i)
300 else:
301 l.append(i)
302 return l
303
304
305class rrule(rrulebase):

Callers 5

testMonthlyByWeekDayMethod · 0.80
testBetweenMethod · 0.80
testBetweenIncMethod · 0.80
test_mlk_dayFunction · 0.80

Calls 1

appendMethod · 0.80

Tested by 5

testMonthlyByWeekDayMethod · 0.64
testBetweenMethod · 0.64
testBetweenIncMethod · 0.64
test_mlk_dayFunction · 0.64