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

Avoid calling the deprecated DateTimeType.getZonedDateTime() #369

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Dec 16, 2024

No description provided.

@jimtng jimtng added the bug Something isn't working label Dec 16, 2024
@jimtng jimtng force-pushed the datetimetype-zdt2 branch 4 times, most recently from c4034d3 to 00dfdf7 Compare December 16, 2024 09:11
@@ -48,7 +48,17 @@ def parse(time_string)
# fields during conversion. Not used in this class.
# @return [ZonedTimeTime]
def to_zoned_date_time(context = nil) # rubocop:disable Lint/UnusedMethodArgument
zoned_date_time
# @deprecated OH 4.2 Just call zoned_date_time(ZoneId.system_default) in OH 4.3
unless instance_variable_defined?(:@zoned_date_time_method)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really inefficient to have to create a method object for every instance of DateTimeType. Instead, do a conditional outside the method, and then define the method (literally) as appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants