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 CultureInfo.InvariantCulture in DateAsText #563

Open
DFU398 opened this issue Mar 14, 2024 · 0 comments · May be fixed by #564
Open

Use CultureInfo.InvariantCulture in DateAsText #563

DFU398 opened this issue Mar 14, 2024 · 0 comments · May be fixed by #564
Assignees

Comments

@DFU398
Copy link
Member

DFU398 commented Mar 14, 2024

Expected Behavior

DateAsText uses CultureInfo.InvariantCulture by default, if no other format provider is given.

Actual Behavior

DateAsText uses CultureInfo.CurrentCulture by default, if no other format provider is given. This is inconsistent with other classes such as DateOf, NumberOf and TextOf, which all use CultureInfo.InvariantCulture.

Mention any other details that might be useful

Also, there is only one constructor that lets us specify a different format provider:

public DateAsText(IScalar<DateTime> date, IText format, IFormatProvider provider)

This is inconvenient in a lot of situations, because the date needs to be wrapped in an IScalar and the format needs to be wrapped in an IText. Maybe we should add these ctors:

public DateAsText(DateTime date, string format, IFormatProvider provider)
public DateAsText(DateTime date, IFormatProvider provider)

Steps to reproduce the behavior

The log given by the failure.

@DFU398 DFU398 self-assigned this May 8, 2024
@DFU398 DFU398 linked a pull request May 8, 2024 that will close this issue
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant