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

Use specified culture/format provider when provided to CalDateTime.ToString #560

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nzbart
Copy link

@nzbart nzbart commented Oct 23, 2022

The ToString method on CalDateTime has useful logic to render the date and/or time components, but this rendering ignores the format provider and always uses the current culture. The format provider is currently used when the format string is specified, but not otherwise.

This PR adds some characterisation tests and alters ToString to use the format provider for date formatting.

I want to make a change to CalDateTime.ToString and want to be confident
that I'm not breaking existing functionality. These tests pass against
the current code.
When using the default format string, callers still want to be able to
specify a formatter to make sure that dates are formatted in their
preferred way.
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.

1 participant