Enhance DateTimeType
to parse ZonedDateTime
with time-zone ID
#4516
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.
This DSL rule:
generates the following output in 4.3:
Until 4.2 this rule worked, because
getZonedDateTime()
returned the sameZonedDateTime
as provided when creating theDateTimeType
. Since it didn't necessarily contain time-zone ID but only offset (e.g. "2024-12-22T16:29+01:00"),DateTimeType.parse
would then be able to parse it in some scenarios. Now, it contains the time-zone ID (e.g. "2024-12-22T16:29+01:00[Europe/Copenhagen]") always, whichDateTimeType.parse
is not able to parse (and never was).To make this rule compatible I would propose to add support for parsing a full
ZonedDateTime
string that includes time-zone ID. If this is accepted, I think it should also be cherry-picked into 4.3.x for immediate value. i.e. to fix rules that might have been broken by 4.3. By the time we reach 5.0, users would otherwise have been forced to refactor their rules already.See https://community.openhab.org/t/datetime-conversion-after-update-to-4-3-0/161053/1
Regression of #3583