mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-01 18:18:31 +00:00
fixes tests where range starts inside an event
test_report_with_expand_property_start_inside test_report_with_expand_property_just_inside Signed-off-by: David Greaves <david@dgreaves.com>
This commit is contained in:
parent
056954387d
commit
ec3366496e
1 changed files with 4 additions and 1 deletions
|
@ -357,6 +357,8 @@ def _expand(
|
||||||
duration = None
|
duration = None
|
||||||
if hasattr(vevent_recurrence, "dtend"):
|
if hasattr(vevent_recurrence, "dtend"):
|
||||||
duration = vevent_recurrence.dtend.value - vevent_recurrence.dtstart.value
|
duration = vevent_recurrence.dtend.value - vevent_recurrence.dtstart.value
|
||||||
|
elif hasattr(vevent_recurrence, "duration"):
|
||||||
|
duration = vevent_recurrence.duration.value
|
||||||
|
|
||||||
# Handle EXDATE to limit expansion range
|
# Handle EXDATE to limit expansion range
|
||||||
if hasattr(vevent_recurrence, 'exdate'):
|
if hasattr(vevent_recurrence, 'exdate'):
|
||||||
|
@ -428,7 +430,8 @@ def _expand(
|
||||||
name='DTSTART',
|
name='DTSTART',
|
||||||
value=recurrence_id.strftime(dt_format), params={}
|
value=recurrence_id.strftime(dt_format), params={}
|
||||||
)
|
)
|
||||||
if duration:
|
# if there is a DTEND, override it. Duration does not need changing
|
||||||
|
if hasattr(vevent, "dtend"):
|
||||||
vevent.dtend = ContentLine(
|
vevent.dtend = ContentLine(
|
||||||
name='DTEND',
|
name='DTEND',
|
||||||
value=(recurrence_id + duration).strftime(dt_format), params={}
|
value=(recurrence_id + duration).strftime(dt_format), params={}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue