Skip to content

Accept DATE values with midnight time suffix - #573

Closed
arrizer wants to merge 1 commit into
allenporter:mainfrom
arrizer:accept-date-with-midnight-time
Closed

Accept DATE values with midnight time suffix#573
arrizer wants to merge 1 commit into
allenporter:mainfrom
arrizer:accept-date-with-midnight-time

Conversation

@arrizer

@arrizer arrizer commented Feb 7, 2026

Copy link
Copy Markdown

Accept DATE values that include a midnight time suffix (YYYYMMDDT000000 or YYYYMMDDT000000Z).

Some calendar generators emit invalid VALUE=DATE values with a midnight time suffix. This is common in real-world ICS feeds. Strict parsing rejects these files even though the intent is unambiguous. Treating midnight time suffixes as dates improves interoperability without impacting valid DATE-TIME inputs.

@arrizer
arrizer marked this pull request as ready for review February 7, 2026 11:22
@allenporter

Copy link
Copy Markdown
Owner

Hello, thank you for the contribution!

Generally, we do not have a goal of allowing malformed calendars to parse validation since we want to avoid this library itself creating invalid calendars and going undetected. If you can show this is part of the rfc5545 then let me know.

We do have an ical.compat module where we can allow some users of ical to opt in to have less strict parsing rules. If you'd to propose a compat module for this, I think that could be a possibility, though I would like to be more specific about which calendars are creating this and at least have some conviction that those calendars can't be fixed (e.g. ideally they'd fix their calendars to not be invalid rather than having every other calendar provider add workarounds)

@arrizer

arrizer commented Feb 14, 2026

Copy link
Copy Markdown
Author

Hey! Thanks for taking a look. I proposed this change for a malformed calendar I tried to use in HomeAssistant, which is using this library to parse iCal files. Unfortunately I have no control over the source of this calendar. Since I noticed that macOS Calendar app accepts the malformed calendar, I thought there would be no harm in also making the parsing here a bit more lenient. I understand if you're hesitant to merge this of course, your call!

@allenporter

Copy link
Copy Markdown
Owner

My recommendation would be the ical.compat approach I mentioned so that we don't need to allow malformed calendars everywhere.

@allenporter
allenporter marked this pull request as draft February 14, 2026 23:06
@allenporter

Copy link
Copy Markdown
Owner

Thanks again for the contribution and raising this! I've resolved this issue by implementing a date compatibility layer under the ical.compat module (matching the feedback here). MALFORMED DATE values with time suffixes will now be silently stripped and parsed successfully when compatibility mode is enabled.

You can track the implementation details in #625. Closing this PR in favor of that solution. Thank you.

@allenporter allenporter closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants