Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add jiff::tz::Offset::round #233

Closed
BurntSushi opened this issue Feb 1, 2025 · 0 comments · Fixed by #234
Closed

add jiff::tz::Offset::round #233

BurntSushi opened this issue Feb 1, 2025 · 0 comments · Fixed by #234
Labels
enhancement New feature or request

Comments

@BurntSushi
Copy link
Owner

This is useful for supporting #231, so we might as well make it public. We can reuse the rounding implementation for SignedDuration, but being careful to make sure we only support Unit::Hour, Unit::Minute and Unit::Second.

@BurntSushi BurntSushi added the enhancement New feature or request label Feb 1, 2025
BurntSushi added a commit that referenced this issue Feb 1, 2025
This is to help support `Offset` equality that rounds to the nearest
minute. It's also pretty easy to add since we can just reuse
`SignedDuration::round`.

We also add `TryFrom<SignedDuration> for Offset` and
`From<Offset> for SignedDuration`.

Closes #233
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant