Skip to content

[MBL-19735][All] Respect device first day of week setting in calendar and to-do#3534

Merged
tamaskozmer merged 5 commits intomasterfrom
MBL-19735-First-day-of-week-use-in-Calendar-and-To-do
Feb 19, 2026
Merged

[MBL-19735][All] Respect device first day of week setting in calendar and to-do#3534
tamaskozmer merged 5 commits intomasterfrom
MBL-19735-First-day-of-week-use-in-Calendar-and-To-do

Conversation

@tamaskozmer
Copy link
Contributor

@tamaskozmer tamaskozmer commented Feb 18, 2026

Test plan:

  1. On your Android device, go to Settings → System → Languages & input → Languages → [Your language] → First day of week
  2. Change the first day of week setting to something other than your locale default (e.g., set it to Wednesday)
  3. Open the Student, Teacher, or Parent app
  4. Navigate to the Calendar view
  5. Verify the calendar now starts with your selected first day of week (e.g., Wednesday)
  6. Open the To-Do list and check date range filters
  7. Verify that week-based filtering correctly uses your selected first day of week
  8. Test the Forecast widget
  9. Verify weeks start on your selected day

refs: MBL-19735
affects: Student, Teacher, Parent
release note: Calendar and to-do lists now respect your device's first day of week setting

  • Follow-up e2e test ticket created or not needed
  • Tested in dark mode
  • Tested in light mode
  • Test in landscape mode and/or tablet
  • A11y checked
  • Approve from product

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR centralizes first-day-of-week logic to use the system locale settings instead of WeekFields.of(Locale.getDefault()). The approach is good and the test mocking is appropriate, but there's a critical type mismatch issue that will prevent compilation.

Issues Found

  • Critical: Type mismatch in LocaleUtils.kt:30,105-113 - Using java.time.DayOfWeek instead of org.threeten.bp.DayOfWeek. The codebase uses ThreeTenBP throughout, and these types are not interchangeable. This will cause compilation errors.

Positive Aspects

Good refactoring approach - Centralizing the first-day-of-week logic into utility functions makes the code more maintainable and testable

Comprehensive changes - All usages of WeekFields.of(Locale.getDefault()) have been properly replaced across the codebase (CalendarComponents.kt, CalendarStateMapper.kt, CreateUpdateEventViewModel.kt, ForecastWidgetViewModel.kt, ToDoFilterUiState.kt)

Proper test mocking - The test files correctly mock getSystemLocaleCalendar() to ensure consistent behavior during testing

Good abstraction - The getSystemLocaleCalendar() function properly handles the device locale extraction using ConfigurationCompat

Recommendation

Please fix the type mismatch issue by changing the import from java.time.DayOfWeek to org.threeten.bp.DayOfWeek and updating the return values in the when expression accordingly. Once this is corrected, the PR will be ready to merge.

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Parent Install Page

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

🧪 Unit Test Results

✅ 📱 Parent App

  • Tests: 309 total, 0 failed, 0 skipped
  • Duration: 37.927s
  • Success Rate: 100%

✅ 📱 Student App

  • Tests: 1248 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 📱 Teacher App

  • Tests: 373 total, 0 failed, 0 skipped
  • Duration: 33.126s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 623 total, 0 failed, 0 skipped
  • Duration: 33.705s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 3083 total, 0 failed, 0 skipped
  • Duration: 51.144s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 5636
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Wed, 18 Feb 2026 12:07:09 GMT

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Teacher Install Page

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Student Install Page

…r-and-To-do

# Conflicts:
#	libs/pandautils/src/main/java/com/instructure/pandautils/features/dashboard/widget/forecast/ForecastWidgetViewModel.kt
@github-actions
Copy link

📊 Code Coverage Report

✅ Student

  • PR Coverage: 42.98%
  • Master Coverage: 42.98%
  • Delta: +0.00%

✅ Teacher

  • PR Coverage: 25.39%
  • Master Coverage: 25.39%
  • Delta: +0.00%

⚠️ Pandautils

  • PR Coverage: 23.61%
  • Master Coverage: 23.61%
  • Delta: -0.00%

📈 Overall Average

  • PR Coverage: 30.66%
  • Master Coverage: 30.66%
  • Delta: -0.00%

Copy link
Contributor

@adamNagy56 adamNagy56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA +1

@tamaskozmer tamaskozmer merged commit c578a95 into master Feb 19, 2026
48 of 49 checks passed
@tamaskozmer tamaskozmer deleted the MBL-19735-First-day-of-week-use-in-Calendar-and-To-do branch February 19, 2026 12:54
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.

3 participants