mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fix(Calendar): getDay 和 getUTCDay 有时间差,导致星期错位 (#4883)
https://github.com/youzan/vant-weapp/issues/4756
This commit is contained in:
parent
9a708747a8
commit
842e88f115
@ -9,7 +9,7 @@ var ROW_HEIGHT = 64;
|
||||
|
||||
function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
|
||||
var style = [];
|
||||
var current = getDate(date).getDay() || 7;
|
||||
var current = getDate(date).getUTCDay() || 7;
|
||||
var offset = current < firstDayOfWeek ? (7 - firstDayOfWeek + current) :
|
||||
current === 7 && firstDayOfWeek === 0 ? 0 :
|
||||
(current - firstDayOfWeek);
|
||||
|
Loading…
x
Reference in New Issue
Block a user