[BUGFIX] Get correct year for weekConfig. Use ISO 8601 week-numbering year #1301
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.
When browsing the calendar by week, I get the wrong year after calendar week 52. It gives me the year 2024 instead of 2025.
sf_event_mgt/Resources/Private/Templates/Event/Calendar.html
Lines 11 to 34 in 5fa7286
Debugging
$firstDayNextWeek
gives me2024-12-30
which results in "2024" for the parametertx_sfeventmgt_pieventcalendar[overwriteDemand][year]=2024
but it should be 2025.sf_event_mgt/Classes/Service/CalendarService.php
Line 163 in 5fa7286
This pull request addresses this issue, by using the parameter
o
for formatting the year.The PHP manual states for the parameter the following:
ISO 8601 week-numbering year. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.