Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify DateTimeType handling #17725

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from
Draft

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Nov 9, 2024

This is a cleanup only and does not change functionality when openhab/openhab-core#3583 has first been merged. The core PR discards time-zone from DateTimeType, thus binding code can be simplified:

  • Instantiations from ZonedDateTime using either time-zone from TimeZoneProvider or ZoneId.systemDefault() have been simplified to use Instant. In some cases this entirely eliminated the need for TimeZoneProvider, which has then been removed.
  • Usages of deprecated methods toZone and toLocaleZone have been removed.
  • Usages of method getZonedDateTime have been removed. In cases where time-zone is needed, getInstant().atZone(ZoneId.systemDefault()) is now explicitly called.

Related to openhab/openhab-core#3583

@jlaur jlaur added work in progress A PR that is not yet ready to be merged awaiting other PR Depends on another PR labels Nov 9, 2024
@jlaur jlaur force-pushed the datetimetype-instant branch 3 times, most recently from 86ec8a2 to d397b88 Compare November 11, 2024 19:29
@jlaur jlaur force-pushed the datetimetype-instant branch 8 times, most recently from 2a79387 to 9940eec Compare November 17, 2024 20:51
@jlaur jlaur mentioned this pull request Nov 18, 2024
@jlaur jlaur force-pushed the datetimetype-instant branch 11 times, most recently from 315137b to b3209c5 Compare November 24, 2024 22:36
@jlaur jlaur force-pushed the datetimetype-instant branch 2 times, most recently from e34093e to fdf7df0 Compare November 25, 2024 21:57
@jlaur jlaur force-pushed the datetimetype-instant branch 2 times, most recently from d7d358e to adc97e5 Compare November 26, 2024 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting other PR Depends on another PR work in progress A PR that is not yet ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant