Skip to content

Conversation

@Manishearth
Copy link
Contributor

Cloning is generally useful, and utc() allows for infallible construction (currently there is no way to infallibly construct a timezone)

@Manishearth
Copy link
Contributor Author

Manishearth commented Jun 20, 2025

Also open to adding a generic infallible construction API for the IanaIdentifier variant.

@Manishearth Manishearth changed the title Add TimeZone::utc() to FFI, add cloningx Add TimeZone::utc() to FFI, add cloning Jun 20, 2025
Box::new(Self(self.0.clone()))
}
pub fn utc() -> Box<Self> {
Box::new(Self(temporal_rs::TimeZone::IanaIdentifier("UTC".into())))
Copy link
Member

Choose a reason for hiding this comment

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

question: any general thoughts on how this may update with any future changes around #330.

I'm mostly concerned about how changes to TimeZone may affect this in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like we're not sure about Copy TimeZones being a thing, in that case I think we should land this

Copy link
Member

Choose a reason for hiding this comment

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

I still think making this copy is the best general approach, but in the meantime agreed on moving forward as is.

@Manishearth Manishearth force-pushed the tz-utc-ffi branch 2 times, most recently from e10ccb5 to 4b504e5 Compare June 21, 2025 00:24
@Manishearth Manishearth changed the title Add TimeZone::utc() to FFI, add cloning Add TimeZone::utc() to FFI Jun 21, 2025
@Manishearth Manishearth merged commit 17e60fb into boa-dev:main Jul 17, 2025
8 checks passed
@Manishearth Manishearth deleted the tz-utc-ffi branch July 17, 2025 18:56
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