Skip to content

Add from_partial for YearMonth/MonthDay FFI#351

Merged
Manishearth merged 2 commits into
boa-dev:mainfrom
Manishearth:from-partial
Jul 21, 2025
Merged

Add from_partial for YearMonth/MonthDay FFI#351
Manishearth merged 2 commits into
boa-dev:mainfrom
Manishearth:from-partial

Conversation

@Manishearth

Copy link
Copy Markdown
Contributor

No description provided.

@nekevss

nekevss commented Jun 17, 2025

Copy link
Copy Markdown
Member

Just to confirm, have you seen #342? That's going to be a breaking change here to YearMonth::from_partial

@Manishearth

Copy link
Copy Markdown
Contributor Author

I have not, that is also an acceptable API. Still need it for MonthDay though. Happy to wait, I have an acceptable workaround for now.

@nekevss

nekevss commented Jun 17, 2025

Copy link
Copy Markdown
Member

I think I'd prefer to wait on this for now. Because there's also #349 to consider too.

@nekevss nekevss added blocked Waiting for some code change and removed blocked Waiting for some code change labels Jun 20, 2025
@Manishearth

Copy link
Copy Markdown
Contributor Author

I'm actually finding myself needing this: the current API is insufficient to implement ToTemporalYearMonth, which needs a way to pass down monthCode. The current hacky implementation I have fails tests.

@nekevss

nekevss commented Jul 16, 2025

Copy link
Copy Markdown
Member

Sounds good. I think this really just needs to be updated to the more recent changes.

@Manishearth

Copy link
Copy Markdown
Contributor Author

Oh, wait, I didn't realize #342 landed. I should just use that lol.

@Manishearth

Copy link
Copy Markdown
Contributor Author

Ah, I still need it over FFI.

@Manishearth

Copy link
Copy Markdown
Contributor Author

I'll keep this PR open until I can fix that.

@Manishearth

Manishearth commented Jul 17, 2025

Copy link
Copy Markdown
Contributor Author

@nekevss I updated this to use the new PartialYearMonth.

Over FFI I still use PartialDate for both of these. I could add a PartialYearMonth over FFI but I don't actually have the need to have nitty gritty Partial types here.

MonthDay must use PartialDate since for non-ISO calendars you can set the year. Misread the spec, see #412

@Manishearth Manishearth merged commit d64c19b into boa-dev:main Jul 21, 2025
8 checks passed
@Manishearth Manishearth deleted the from-partial branch July 21, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants