-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Service IDateTimeFormatter #9053
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
Merged
yaira2
merged 14 commits into
files-community:main
from
cinqmilleans:Service.DateTimeFormatter
May 15, 2022
Merged
Service IDateTimeFormatter #9053
yaira2
merged 14 commits into
files-community:main
from
cinqmilleans:Service.DateTimeFormatter
May 15, 2022
Conversation
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
@BanCrash I made a small style change. |
BanCrash
previously approved these changes
May 11, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the opinion of @d2dyno1 , but this LGTM.
d2dyno1
approved these changes
May 14, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
Merged
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.
Replace DateTimeExtensions by service IDateTimeFormatter.
This pr is a refactor that profoundly changes the structure of date formatting. This pr releases ListedItem from this coupling to prepare its refactoring.
Resolved / Related Issues
DateTimeExtensions is a design issue: static class that exposes unused methods, difficult to add/modify a date format because everything is done in the same implementation, use of returnFormat as constructor parameter of many classes that shouldn't fit care about it, public method that returns 4 values in a tuple, read user parameters on each call.
Details of Changes
This pr creates a new IDateTimeFormatter service and its 3 user parameter implementations, and an implementation (provided by IServiceProvider) that still behaves like the user format.
DateTimeExtensions is removed.
All uses of returnFormat are removed. The other classes don't have to worry about it.
Use an event to change format.
The initialisation of the setting windows is simpler because of inheritance.
Validation
How did you test these changes?