diff --git a/server/planning/feed_parsers/events_ml.py b/server/planning/feed_parsers/events_ml.py index 0c1317641..2085843f3 100644 --- a/server/planning/feed_parsers/events_ml.py +++ b/server/planning/feed_parsers/events_ml.py @@ -238,10 +238,8 @@ def parse_event_schedule(self, dates, item): tz=tz, ) - if all_day: - item["dates"]["all_day"] = all_day - elif no_end_time: - item["dates"]["no_end_time"] = no_end_time + item["dates"]["all_day"] = all_day + item["dates"]["no_end_time"] = (not all_day and no_end_time) is True def parse_registration_details(self, event_details, item): event_type = get_planning_schema("event") diff --git a/server/planning/feed_parsers/events_ml_test.py b/server/planning/feed_parsers/events_ml_test.py index 598a218d7..084da54e1 100644 --- a/server/planning/feed_parsers/events_ml_test.py +++ b/server/planning/feed_parsers/events_ml_test.py @@ -155,6 +155,8 @@ def get_item_dates(start: str, end: Optional[str] = None): start=datetime(2022, 7, 5, 15, 0, tzinfo=utc), end=datetime(2022, 7, 5, 17, 0, tzinfo=utc), tz=self.app.config["DEFAULT_TIMEZONE"], + all_day=False, + no_end_time=False, ), ) @@ -165,6 +167,8 @@ def get_item_dates(start: str, end: Optional[str] = None): start=datetime(2022, 7, 5, 15, 0, tzinfo=utc), end=datetime(2022, 7, 5, 16, 0, tzinfo=utc), tz=self.app.config["DEFAULT_TIMEZONE"], + all_day=False, + no_end_time=False, ), ) @@ -175,6 +179,7 @@ def get_item_dates(start: str, end: Optional[str] = None): start=datetime(2022, 7, 5, 0, 0, tzinfo=utc), end=datetime(2022, 7, 5, 23, 59, 59, tzinfo=utc), all_day=True, + no_end_time=False, tz=None, ), ) @@ -187,6 +192,7 @@ def get_item_dates(start: str, end: Optional[str] = None): start=datetime(2022, 7, 5, 0, 0, tzinfo=utc), end=datetime(2022, 7, 7, 23, 59, 59, tzinfo=utc), all_day=True, + no_end_time=False, tz=None, ), ) diff --git a/server/planning/feed_parsers/onclusive.py b/server/planning/feed_parsers/onclusive.py index dc35cf3e7..6b276a204 100644 --- a/server/planning/feed_parsers/onclusive.py +++ b/server/planning/feed_parsers/onclusive.py @@ -127,12 +127,14 @@ def parse_event_details(self, event, item): end=max(start_date, end_date), no_end_time=True, tz=tz, + all_day=False, ) else: item["dates"] = dict( start=self.datetime(event["startDate"], "00:00:00"), end=self.datetime(event["endDate"], "00:00:00"), all_day=True, + no_end_time=False, ) def parse_timezone(self, start_date, event): diff --git a/server/planning/feed_parsers/onclusive_tests.py b/server/planning/feed_parsers/onclusive_tests.py index 120933ab6..70a49eab8 100644 --- a/server/planning/feed_parsers/onclusive_tests.py +++ b/server/planning/feed_parsers/onclusive_tests.py @@ -138,6 +138,7 @@ def test_cst_timezone(self): { "start": datetime.datetime(2023, 4, 18, 2, tzinfo=datetime.timezone.utc), "end": datetime.datetime(2023, 4, 18, 2, tzinfo=datetime.timezone.utc), + "all_day": False, "no_end_time": True, "tz": "Asia/Macau", },