Skip to content

Conversation

@kricsleo
Copy link
Collaborator

resolves #2157
resolves #2264

❗❗This may be a breaking change for those who rely on weekStartsOn to behave differently across locales.

As I've seen more users confused by this implicit behavior, I think it's better to define weekStartsOn in a fixed and explicit way, where the day of the week is always Sun(0), Mon(1), ..., Sat(6). This also aligns with other date libraries, e.g., date-fns, making it more predictable.

However, this would break users who rely on the previous behavior by specifying different weekStartsOn values for different locales to make the calendar always start on "Monday" or other days.

For example:

Before: locale="en-GB" :weekStartsOn="0" === locale="en-US" :weekStartsOn="1" === "week starts on Monday"

After: locale="en-GB" :weekStartsOn="1" === locale="en-US" :weekStartsOn="1" === "week starts on Monday"

I've also considered adding a new prop (e.g., fixedWeekStartsOn: boolean) to only change the behavior when this prop is set, which could avoid breaking changes. However, this would add complexity to the library, and the default behavior would still remain confusing (and we'd have to document it, etc.). WDYT? cc @zernonia

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 27, 2025

Open in StackBlitz

npm i https://pkg.pr.new/reka-ui@2359

commit: f162481

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.

[Bug]: weekStartsOn does not work correctly with non-English locale [Bug]: weekStartsOn changes depending on locale

1 participant