[go: nahoru, domu]

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

4.5.2 #163

Merged
merged 23 commits into from
Sep 8, 2023
Merged

4.5.2 #163

merged 23 commits into from
Sep 8, 2023

Conversation

ME-MarvinE
Copy link
Owner

Release 4.5.2

ME-MarvinE and others added 23 commits July 28, 2023 20:17
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 (#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.
@ME-MarvinE ME-MarvinE merged commit ae4dff8 into master Sep 8, 2023
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.

None yet

1 participant