Skip to content

initial implementation of ToZonedDateTime, ToPlainDate, ToPlainTime#244

Merged
nekevss merged 5 commits intoboa-dev:mainfrom
lockels:plain_date_time
Mar 16, 2025
Merged

initial implementation of ToZonedDateTime, ToPlainDate, ToPlainTime#244
nekevss merged 5 commits intoboa-dev:mainfrom
lockels:plain_date_time

Conversation

@lockels
Copy link
Copy Markdown
Contributor

@lockels lockels commented Mar 15, 2025

Fixes #149

Copy link
Copy Markdown
Member

@nekevss nekevss 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!

This is about ready to merge, but I do have a couple nits that would be nice to have addressed. Mostly because they could be easily forgotten if not addressed in this PR and it's within scope.

Ok(Self::new_unchecked(result, self.calendar.clone()))
}

pub fn to_zoned_date_time_with_provider(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: add a PlainDateTime::to_zoned_date_time implementation on PlainDateTime in compiled.

It looks like I missed adding this stub. So a new module should be added to the compiled directory for PlainDateTime and the companion method added.

Worthwhile note: there's no current need to add this method to temporal_capi just yet because time zone providers over the FFI is still a work in progress. So only the non provider method implementation is needed.

))
}

pub fn to_plain_date(&self) -> TemporalResult<PlainDate> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: add a temporal_capi implementation of to_plain_date for the FFI

This one may be a little harder because it's dealing with the diplomat bindings, but maybe you can take a crack at it. Changes should be made here.

@nekevss
Copy link
Copy Markdown
Member

nekevss commented Mar 16, 2025

Broken CI is from the new FFI needing to be checked in.

Just run:

cargo run -p diplomat-gen

Commit the generated output, and everything should be good to go.

Copy link
Copy Markdown
Member

@nekevss nekevss 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! Thanks again!

As a heads up, I'm going to open up an issue partially related to this PR about return types used, but I think it's a broader issue across the repository and out of scope of this specific PR.

@nekevss nekevss merged commit 5d21776 into boa-dev:main Mar 16, 2025
8 checks passed
@lockels lockels deleted the plain_date_time branch March 17, 2025 10:54
sebastianjacmatt pushed a commit to sebastianjacmatt/temporal that referenced this pull request Mar 17, 2025
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.

Implement ToZonedDateTime, toPlainDate, and toPlainTime method for PlainDateTime

2 participants