You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I use dayjs.locale('zh-cn'), but dayjs('2024-11-24').day(1) return 2024-11-25 Expected behavior
dayjs.locale('zh-cn')
dayjs('2024-11-24').day(1) return '2024-11-18' Information
Day.js Version 1.11.8
OS: windows
Browser chrome
Time zone: [e.g. GMT-08:00
The text was updated successfully, but these errors were encountered:
Sorry, I was to quick with my reply. I didn't imported the locale first, thats why setting the locale first. @cannot-hero mayby this fixes it for you too: import 'dayjs/locale/zh';
@baddel73 thanks for your reply, but this still doesn't work for me, to solve this problem, i use function getFirstDayOfWeek(date, formatType = 'YYYY-MM-DD') { return dayjs(date).startOf('week').format(formatType) }
in this case, after use dayjs.locale('zh-cn'), the start of week will be Monday. This isn't an elegant approach, but it works.
Describe the bug
I use dayjs.locale('zh-cn'), but dayjs('2024-11-24').day(1) return 2024-11-25
Expected behavior
dayjs.locale('zh-cn')
dayjs('2024-11-24').day(1) return '2024-11-18'
Information
The text was updated successfully, but these errors were encountered: