Skip to content

fix(locale): correct Maldivian (dv) weekStart from 7 to 0 - #3183

Open
koding88 wants to merge 1 commit into
iamkun:devfrom
koding88:fix/dv-weekstart
Open

fix(locale): correct Maldivian (dv) weekStart from 7 to 0#3183
koding88 wants to merge 1 commit into
iamkun:devfrom
koding88:fix/dv-weekstart

Conversation

@koding88

Copy link
Copy Markdown

Summary

src/locale/dv.js declares weekStart: 7, which is outside the valid 0..6 domain (0 = Sunday … 6 = Saturday). It only behaved like a Sunday start by accident of the week-gap arithmetic in startOf('week') (gap = ($W + 7) - 7 = $W), so nothing ever caught it — the generic locale-keys test only asserts weekStart is a number.

Per CLDR, the week in the Maldives starts on Sunday, i.e. weekStart: 0.

Fixes #1535

Changes

  • weekStart: 7weekStart: 0
  • New test/locale/dv.test.js: asserts weekStart === 0 and that every day of the week resolves startOf('week') / endOf('week') to Sunday / Saturday under the dv locale, so a future out-of-range value cannot slip through again.

Checklist

  • npm run lint clean
  • npm test green — 94 suites / 797 tests, line coverage unchanged at 100%

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
Copilot AI lite review requested due to automatic review settings August 24, 2026 16:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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.js to set weekStart: 0 (Sunday).
  • Add test/locale/dv.test.js to assert weekStart is 0 and validate startOf('week') / endOf('week') behavior across all weekdays under the dv locale.
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.

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.

firstDayOfWeek for Maldivian (dv) is 7 instead of 0 through 6

2 participants