Fix: Handle XSD end-of-day midnight notation 24:00:00#582
Merged
Conversation
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
s-heppner
requested changes
Jul 6, 2026
paul-gerber-svg
force-pushed
the
xsd-midnight-24
branch
3 times, most recently
from
July 6, 2026 14:26
68765c6 to
54bc503
Compare
Co-authored-by: s-heppner <iat@s-heppner.com>
paul-gerber-svg
force-pushed
the
xsd-midnight-24
branch
from
July 9, 2026 07:26
54bc503 to
26506f8
Compare
paul-gerber-svg
force-pushed
the
xsd-midnight-24
branch
2 times, most recently
from
July 9, 2026 08:11
2d581f1 to
f805fe6
Compare
paul-gerber-svg
force-pushed
the
xsd-midnight-24
branch
from
July 9, 2026 08:12
f805fe6 to
fe83cae
Compare
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
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before, parsing XSD timestamps with an hour of 24 causes a ValueError. Now, the parser in
sdk/basyx/aas/model/datatypes.pycorrectly identifies 24:00:00 as midnight, handles the day rollover forDateTime, and normalizesTimeto 00:00:00.Unit tests for valid and invalid edge cases are added to
sdk/test/model/test_datatypes.pyinsideTestDateTimeTypes.Fixes #564