XCX-Plugins icon indicating copy to clipboard operation
XCX-Plugins copied to clipboard

[Bug] mode normal 下的 不同时区下月日历显示有误

Open LiangSFS opened this issue 4 years ago • 0 comments

我遇到的问题:澳大利亚时区下的2021年4月,显示有两个4日;定位到的问题 image

我的解决方案:

在components/calendar/index.js 文件 使用moment 的日期库 // let date = new Date(currenDate.getTime() + 86400000 * i); let date = new Date(moment(currenDate.getTime()).add(i, 'days').valueOf())

而且进一步在 getMonthDayCount 方法获取 一个月的天数最好也是使用 moment

// return (d_next_month_first_day.getTime() - d_first_day.getTime()) / 86400000; return moment(d_next_month_first_day.getTime()).diff(moment(d_first_day.getTime()), 'days')

LiangSFS avatar Apr 19 '21 03:04 LiangSFS