arco-design-vue
arco-design-vue copied to clipboard
Don't update global dayjs locale but make sure dayStartOfWeek can work properly
trafficstars
Types of changes
- [ ] New feature
- [x] Bug fix
- [ ] Enhancement
- [ ] Component style change
- [ ] Typescript definition change
- [ ] Documentation change
- [ ] Coding style change
- [ ] Refactoring
- [ ] Test cases
- [ ] Continuous integration
- [ ] Breaking change
- [ ] Others
Background and context
fixing for:
- #3021
- #3039
- #3509
Basically, I don't think we need to update global dayjs locale with dayStartOfWeek set in date-picker component, doing this will make impact on global dayjs component. And we can see the inconsistent behaviors caused by this action in issue #3509.
Solution
- Don't update global dayjs locale with dayStartOfWeek value passed to date-picker
- But when getting week in year value when rendering week picker, make sure dayStartOfWeek get considered properly
How is the change tested?
Check the two week pickers in date-picker page, when dayStartOfWeek is 0, 2025 has 53 weeks, at the second week picker with dayStartOfWeek = 1 , we should have 52 weeks in 2025.
Changelog
| Component | Changelog(CN) | Changelog(EN) | Related issues |
|---|---|---|---|
| date-picker | 不修改dayjs全局locale配置 | Don't change global dayjs locale settings | #3021, #3039, #3509 |