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

Refactor TimeFormatter #460

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Refactor TimeFormatter #460

merged 1 commit into from
Jan 14, 2025

Conversation

axunonb
Copy link
Member

@axunonb axunonb commented Jan 14, 2025

  • SmartFormat.Extensions.Time.csproj includes System.Text.Json.
  • Enhance TimeFormatter to handle TimeOnly type (in supported frameworks).
  • Update CommonLanguagesTimeTextInfo to load data from JSON resources and marked old properties as obsolete.
  • Add JSON resource files for de, en, es, fr, it, pt languages.
  • Introduce TimeTextInfoData struct to read localization data from JSON
  • Update and add tests in TimeFormatterTests.
  • Update the Wiki for TimeFormatter

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97%. Comparing base (a809969) to head (8873c9c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #460   +/-   ##
===================================
  Coverage    97%    97%           
===================================
  Files        96     96           
  Lines      3437   3347   -90     
===================================
- Hits       3320   3243   -77     
+ Misses      117    104   -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@axunonb axunonb force-pushed the pr/timefmt branch 2 times, most recently from f756194 to 28c4c5a Compare January 14, 2025 21:24
- `SmartFormat.Extensions.Time.csproj` includes `System.Text.Json`.
- Enhance `TimeFormatter` to handle `TimeOnly` type (in supported frameworks).
- Update `CommonLanguagesTimeTextInfo` to load data from JSON resources and marked old properties as obsolete.
- Add JSON resource files for de, en, es, fr, it, pt languages.
- Accept `TimeOnly` argument for NET6_0_OR_GREATER
- Introduce `TimeTextInfoData` struct to read localization data from JSON
- Update and add tests in `TimeFormatterTests`.
@imprima imprima merged commit beb82ef into axuno:main Jan 14, 2025
5 checks passed
@axunonb axunonb deleted the pr/timefmt branch January 14, 2025 22:29
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.

2 participants