-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
4.5.2 #163
Merged
Merged
4.5.2 #163
Conversation
This file contains 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
I have added a test battery for DayOfWeekExtensions and for DateTimeExtensions. I hope I can help. Nice work
Add ES,EN,PT,IT,FR,DE languages
We can delete all these lines, having a cleaner and more maintainable file.
refactor LocalizeDayOfWeekAndCharLimitConverter and StringCharLimitConverter
What do you think of this functionality? I have added support for Spanish, English, German, French, Italian and Portuguese. I have refactored the StringCharLimitConverter converter, I have added its text truncation functionality to the Core in StringsExtensions and I have added a Test battery. The new converter, LocalizeDayOfWeekAndCharLimitConverter, translates the name of the DayOfWeek enum into its day of the week based on the device's language. Spanish sample screenshot: ![Screenshot_2023-09-04-15-33-50-984_com companyname xcalendarmauisample](https://github.com/ME-MarvinE/XCalendar/assets/21368617/44cb626b-e658-48fa-95ee-09c4357f83df)
…urrentCulture instead of CultureInfo.CurrentUICulture
…ure instead of CurrentUICulture for defaults (#160) CultureInfo.CurrentUICulture should not be used unless the result is used for the UI. While this is the case for XCalendar.Forms and XCalendar.Maui, it is not the case for XCalendar.Core.
…rs not being passed
…rs not being passed (#161) Methods such as `FirstDayOfWeek` specify an optional parameter "startingDayOfWeek" of type `DayOfWeek` which affects the result of the calculation. If this isn't specified, it uses `CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek` which could vary depending on what machine the tests are run on. Since the result varies with the machine's culture but the inputs don't, and the tests were created on a machine using a culture with a different start of week than mine, the tests failed. Added an additional parameter to the test inputs and set the inputs to `DayOfWeek.Sunday` since the tests passed when `CultureInfo.InvariantCulture.DateTimeFormat.FirstDayOfWeek` was passed and that was its value.
This method is now redundant since it only calls the methods from the parameters that are passed. Both the extension method and its implementation would only take one line of code to use.
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.
Release 4.5.2