Open zhangqh22 opened 2 years ago
取week的时候,日期错误,例如dayjs().week(1),结果错误 dayjs("2022-8-8").week(1).format("YYYY-MM-DD") //2021-12-27 dayjs("2022-8-9").week(1).format("YYYY-MM-DD") //2021-12-28
dayjs().week(1)
dayjs("2022-8-8").week(1).format("YYYY-MM-DD") //2021-12-27
dayjs("2022-8-9").week(1).format("YYYY-MM-DD") //2021-12-28
Hi, week() function is locale specific, so you should import your locale before. Here is a demo with Russian locale.
week()
@zhangqh22 please refer to @Bykiev 's explanation
多谢,thank you too much
取week的时候,日期错误,例如
dayjs().week(1)
,结果错误dayjs("2022-8-8").week(1).format("YYYY-MM-DD") //2021-12-27
dayjs("2022-8-9").week(1).format("YYYY-MM-DD") //2021-12-28