Skip to content

[Bug]: weekStartsOn does not work correctly with non-English locale #2264

@ploca14

Description

@ploca14

Environment

Development OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager: [email protected]
Reka UI version: 2.0.0
Vue version: 3.0.0
Locale tested: cs-CZ
Nuxt mode: universal

Link to minimal reproduction

https://stackblitz.com/edit/c5xh3s73?file=src%2FApp.vue

Steps to reproduce

  1. Render RangeCalendarRoot or CalendarRoot and pass weekStartsOn=1 and locale='cs-CZ'.
  2. Observe that the calendar grid starts on Tuesday, not Monday.
  3. Repeat with weekStartsOn=1 and locale='en-US': calendar starts on Monday as expected.
  4. This shows weekStartsOn logic does not work correctly for Czech or other non-English locales.

Describe the bug

When weekStartsOn is set to 1 (Monday) and locale is set to cs-CZ, the calendar week starts on Tuesday instead of Monday. This does not happen when locale is en-US.

It appears that week grid calculation internally uses getDayOfWeek(date, locale), which maps weekdays differently based on locale. The week arithmetic should be locale-insensitive: weekStartsOn=1 should always mean Monday, regardless of locale.

Expected behavior

Passing weekStartsOn=1 should always make the week start on Monday, independent of locale. Locale should only affect weekday names, not grid calculation.

Context & Screenshots (if applicable)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions