Consider accommodation for trip end date
This commit is contained in:
parent
72e7945fbe
commit
6475692db1
|
@ -56,7 +56,14 @@ class Trip:
|
|||
travel_end = max(arrive) if arrive else datetime.date.min
|
||||
assert isinstance(travel_end, datetime.date)
|
||||
|
||||
max_date = max(max_conference_end, travel_end)
|
||||
accommodation_end = (
|
||||
max(as_date(item["to"]) for item in self.accommodation)
|
||||
if self.accommodation
|
||||
else datetime.date.min
|
||||
)
|
||||
assert isinstance(accommodation_end, datetime.date)
|
||||
|
||||
max_date = max(max_conference_end, travel_end, accommodation_end)
|
||||
return max_date if max_date != datetime.date.min else None
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in a new issue