Skip to content

Add ZonedDateTime calendar accessor methods #117

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

Merged
merged 2 commits into from
Dec 7, 2024
Merged

Conversation

nekevss
Copy link
Member

@nekevss nekevss commented Nov 28, 2024

This PR is dependent on #115 and will need a rebase once that PR is merged.

This continues to build out methods that ZonedDateTime needs for accessor methods.

Overall the features implemented are:

  • All calendar accessor methods
  • An implementation of HoursInDay method

@nekevss nekevss force-pushed the impl-zdt-calendar-methods branch from 15b4056 to 9baaaa4 Compare November 28, 2024 05:22
@nekevss nekevss force-pushed the impl-zdt-calendar-methods branch from 9baaaa4 to 0920d60 Compare December 7, 2024 00:17
@nekevss nekevss marked this pull request as ready for review December 7, 2024 00:20
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Looks good! I just have a small thought that we can address later.

self.hours_in_day_with_provider(provider.deref())
}

pub fn hours_in_day_with_provider(&self, provider: &impl TzProvider) -> TemporalResult<u8> {
Copy link
Member

Choose a reason for hiding this comment

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

Thought: we should probably change the provider argument to &(impl TzProvider + ?Sized), since the current type doesn't allow passing trait objects.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm, true. I'll update in a follow up.

@nekevss nekevss merged commit a5d9815 into main Dec 7, 2024
5 checks passed
@nekevss nekevss deleted the impl-zdt-calendar-methods branch December 9, 2024 02:35
@jedel1043 jedel1043 added C-enhancement New feature or request C-api Changes related to the public API labels Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-api Changes related to the public API C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants