-
Notifications
You must be signed in to change notification settings - Fork 99
Description
Feature Request: Support for Custom Week Number Calculation
Is your feature suggestion related to a problem? Please describe.
The current WeekView implementation only supports standard ISO week numbering, which starts from the first week of January. This limitation is problematic for applications that need to display custom calendar systems, such as:
- Academic calendars where the academic year starts in September
- Fiscal year calendars that don't align with the calendar year
- Custom organizational calendars with specific start dates
Currently, there's no way to customize how week numbers are calculated, making the library unsuitable for these use cases.
Describe the solution you'd like
Add support for custom week number calculation by introducing a beginWeekCalendar property in WeekView. This property would accept a Calendar object representing the start date from which week numbers should be calculated. When set, the week numbers displayed in the header would be calculated from this custom start date rather than from the beginning of the calendar year.
For example:
- If
beginWeekCalendaris set to September 1st, 2024, then September 1-7 would be displayed as "Week 1" - The week numbers would increment from this custom start date
Describe alternatives you've considered
- Forking and modifying the library: This requires maintaining a separate fork and missing out on future updates
- Post-processing the displayed week numbers: This would be hacky and wouldn't integrate well with the library's internal logic
- Using a different calendar library: Would require significant migration effort for existing users
Additional context
This feature would be particularly useful for educational institutions and businesses that operate on non-standard calendar cycles. The implementation should:
- Be backward compatible (when
beginWeekCalendaris null, use the default week numbering) - Use the standard Calendar API for better compatibility with older Android versions (avoiding Java 8 time API)
- Be easily configurable through the WeekView's public API
The proposed implementation maintains full backward compatibility while adding this valuable flexibility for custom calendar systems.