fix(locale): correct Maldivian (dv) weekStart from 7 to 0 - #3183
Open
koding88 wants to merge 1 commit into
Open
Conversation
weekStart must be within 0..6; the value 7 only behaved like a Sunday start by accident of the week gap arithmetic. Per CLDR, the week in the Maldives starts on Sunday. Fixes iamkun#1535
There was a problem hiding this comment.
🟢 Approval recommended
The change corrects an invalid locale value and adds focused regression tests that validate the intended week-boundary behavior.
Pull request overview
This PR corrects the Maldivian (dv) locale configuration so weekStart uses the valid Sunday value (0) instead of the out-of-range value (7), and adds targeted tests to prevent this regression from slipping through locale key validation again.
Changes:
- Update
src/locale/dv.jsto setweekStart: 0(Sunday). - Add
test/locale/dv.test.jsto assertweekStartis0and validatestartOf('week')/endOf('week')behavior across all weekdays under thedvlocale.
File summaries
| File | Description |
|---|---|
| src/locale/dv.js | Fixes dv locale’s weekStart to a valid CLDR-aligned value (Sunday = 0). |
| test/locale/dv.test.js | Adds regression tests ensuring dv week boundaries resolve to Sunday–Saturday and weekStart remains valid. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
src/locale/dv.jsdeclaresweekStart: 7, which is outside the valid0..6domain (0 = Sunday … 6 = Saturday). It only behaved like a Sunday start by accident of the week-gap arithmetic instartOf('week')(gap = ($W + 7) - 7 = $W), so nothing ever caught it — the generic locale-keys test only assertsweekStartis a number.Per CLDR, the week in the Maldives starts on Sunday, i.e.
weekStart: 0.Fixes #1535
Changes
weekStart: 7→weekStart: 0test/locale/dv.test.js: assertsweekStart === 0and that every day of the week resolvesstartOf('week')/endOf('week')to Sunday / Saturday under thedvlocale, so a future out-of-range value cannot slip through again.Checklist
npm run lintcleannpm testgreen — 94 suites / 797 tests, line coverage unchanged at 100%