Improve the precision of Date, Duration composition#7867
Open
cady-b wants to merge 1 commit intotypst:mainfrom
Open
Improve the precision of Date, Duration composition#7867cady-b wants to merge 1 commit intotypst:mainfrom
Date, Duration composition#7867cady-b wants to merge 1 commit intotypst:mainfrom
Conversation
t-rapp
reviewed
Feb 16, 2026
Contributor
There was a problem hiding this comment.
These date→datetime changes happen due to the internal implementation of today() in the current test runner. With #7853 applied they will be gone / fixed.
Contributor
Author
There was a problem hiding this comment.
Are you sure this section should be affected by 7853?. I pulled your PR and re-ran the test-suite; adding the time to these two lines is still required in order to pass.
nvm I was thinking of 7856. I'll wait for 53 to merge and see if there are conflicts then
Contributor
Author
There was a problem hiding this comment.
Ah, I see. The PR was indeed affected; I'm pushing the changes now!
Thanks for the heads-up ^^
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7843 by upcasting
Dateto aPrimitiveDateTimeduring composition withDurationoutdated (see discussion below)
This caused two existing tests in
tests/suite/foundations/datetime.typto change; I believe those would be considered improvements.I also explored unconditionally producing a full
Datetimeinstead of checking if aDatesuffices, but that touched more existing tests and I do like how Typst generally doesn't give unnecessary precision on user-facing stuff.