Skip to content

Conversation

cinqmilleans
Copy link
Contributor

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?

  • Built and ran the app
  • Tested the changes for accessibility

@cinqmilleans
Copy link
Contributor Author

@BanCrash I made a small style change.

BanCrash
BanCrash previously approved these changes May 11, 2022
Copy link
Contributor

@BanCrash BanCrash left a 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.

Copy link
Member

@d2dyno1 d2dyno1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels May 15, 2022
@yaira2 yaira2 merged commit 77a6d2b into files-community:main May 15, 2022
@cinqmilleans cinqmilleans mentioned this pull request May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants