Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Expose the useful constant values in TimeSpan #103498

Merged
merged 5 commits into from
Jun 19, 2024

Conversation

IDisposable
Copy link
Contributor

@IDisposable IDisposable commented Jun 15, 2024

Make the useful constants that TimeSpan declared internal to now be public because they're rooted in hard reality and not changeable, and quite useful elsewhere.

Updated the reference assembly to include the new fields.

Updated the DateTime classes, Calendar classes, and other miscellaneous classes in runtime use the newly exposed values for the intervals.

Fixes #94545

Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 15, 2024
@IDisposable
Copy link
Contributor Author

IDisposable commented Jun 15, 2024

Looks like I need to add the triple-slash doc for those new const fields... will do that after the rest of the reviews are in :)

Added the missing documentation blocks following the pattern of the single existing one from before.

@tarekgh tarekgh added this to the 9.0.0 milestone Jun 15, 2024
@IDisposable
Copy link
Contributor Author

Clean build now

@tarekgh
Copy link
Member

tarekgh commented Jun 17, 2024

@IDisposable thanks for getting this ready. Let's wait resolve #103498 (review) and update the wrong doc remark, then we should be good to go.

Make the useful constants that TimeSpan has internally declare public because they're rooted in hard reality and not changeable, and quite useful elsewhere.
Update reference assembly and use the newly exposed values in all  the places in Calendar and DateTime and related classes.
Fixes dotnet#94545
Since this source is also built for older frameworks, leave the constant here.
Cast at call-site to prevent performance degradation.
@tarekgh
Copy link
Member

tarekgh commented Jun 18, 2024

@IDisposable why did you force push the commits?

@IDisposable
Copy link
Contributor Author

I just rebased to current main (didn't know anyone had approved). There were no actual changes since the move back to casting to int at the call sites.

@tarekgh tarekgh merged commit 5fed175 into dotnet:main Jun 19, 2024
132 of 146 checks passed
@tarekgh
Copy link
Member

tarekgh commented Jun 19, 2024

Thanks again @IDisposable for helping with this change.

@IDisposable
Copy link
Contributor Author

New PR to drop to int for most constants #103721

tarekgh added a commit that referenced this pull request Jun 19, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.DateTime community-contribution Indicates that the PR has been added by a community member new-api-needs-documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: Expose the remaining const values in TimeSpan
3 participants