Skip to content

Fix: Handle XSD end-of-day midnight notation 24:00:00#582

Merged
s-heppner merged 8 commits into
eclipse-basyx:developfrom
rwth-iat:xsd-midnight-24
Jul 14, 2026
Merged

Fix: Handle XSD end-of-day midnight notation 24:00:00#582
s-heppner merged 8 commits into
eclipse-basyx:developfrom
rwth-iat:xsd-midnight-24

Conversation

@paul-gerber-svg

Copy link
Copy Markdown
Contributor

Before, parsing XSD timestamps with an hour of 24 causes a ValueError. Now, the parser in sdk/basyx/aas/model/datatypes.py correctly identifies 24:00:00 as midnight, handles the day rollover for DateTime, and normalizes Time to 00:00:00.

Unit tests for valid and invalid edge cases are added to sdk/test/model/test_datatypes.py inside TestDateTimeTypes.

Fixes #564

Before, parsing XSD timestamps with an hour of 24 causes a ValueError.
Now, the parser in `sdk/basyx/aas/model/datatypes.py` correctly identifies 24:00:00 as midnight, handles the day rollover for `DateTime`, and normalizes `Time` to 00:00:00.

Unit tests for valid and invalid edge cases are added to `sdk/test/model/test_datatypes.py` inside `TestDateTimeTypes`.

Fixes eclipse-basyx#564
Comment thread sdk/basyx/aas/model/datatypes.py Outdated
Comment thread sdk/basyx/aas/model/datatypes.py Outdated
Comment thread sdk/basyx/aas/model/datatypes.py
Comment thread sdk/basyx/aas/model/datatypes.py
@s-heppner s-heppner added this to the Release 2.1.0 milestone Jul 6, 2026
@paul-gerber-svg
paul-gerber-svg force-pushed the xsd-midnight-24 branch 3 times, most recently from 68765c6 to 54bc503 Compare July 6, 2026 14:26
@paul-gerber-svg
paul-gerber-svg force-pushed the xsd-midnight-24 branch 2 times, most recently from 2d581f1 to f805fe6 Compare July 9, 2026 08:11
Previously, `_parse_xsd_date`, `_parse_xsd_datetime`, and
`_parse_xsd_time` instantiated `Date`, `DateTime`, and `Time` with
several positional `int(...)` arguments on a single line, making it
hard to tell which regex group fed which field.

This change switches these three constructor calls to keyword
arguments, one per line, so each value is clearly labeled.
@s-heppner
s-heppner merged commit 60a30be into eclipse-basyx:develop Jul 14, 2026
15 checks passed
@s-heppner
s-heppner deleted the xsd-midnight-24 branch July 14, 2026 09:31
@s-heppner s-heppner mentioned this pull request Jul 16, 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