Skip to content

Add from_partial methods to PlainTime, PlainDate, and PlainDateTime #106

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 3 commits into from
Nov 4, 2024

Conversation

nekevss
Copy link
Member

@nekevss nekevss commented Nov 3, 2024

This PR primarily adds from_partial methods to PlainTime, PlainDate, and PlainDateTime.

This also begins to add doc tests to some high visibility methods and also sets the Constrain option of ArithmeticOverflow as the default.

@nekevss nekevss added C-documentation Improvements or additions to documentation C-enhancement New feature or request C-api Changes related to the public API labels Nov 3, 2024
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 great!

@jedel1043 jedel1043 merged commit 345ad54 into main Nov 4, 2024
5 checks passed
@jedel1043 jedel1043 deleted the add-partial-methods branch November 4, 2024 16:40
partial.year.is_some() || (partial.era.is_some() && partial.era_year.is_some());
let month_check = partial.month.is_some() || partial.month_code.is_some();
if !year_check || !month_check || partial.day.is_none() {
return Err(TemporalError::range().with_message("Invalid PlainDate fields provided."));
Copy link

Choose a reason for hiding this comment

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

I think this is supposed to be a TypeError. If I understand the Rust code correctly, it's implementing a part of CalendarResolveFields?

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-documentation Improvements or additions to documentation C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants