我正在使用来自https://sensortower.github.io/daterangepicker/docs#configuration的数据采集器
$(".daterangepicker-field").daterangepicker({
startDate:moment(),
endDate:moment(),
timeZone:'Europe/Bucharest',
forceUpdate: true,
orientation:'left',
ranges:{},
periods: ['day','week','month','year'],
expanded:true,
firstDayOfWeek: 0,
minDate:'2019-01-01',
callback: function(startDate, endDate, period){
var title = startDate.format('MMM D, YYYY') + ' – ' + endDate.format('MMM D, YYYY');
$(this).val(title);
}
});问题是,如果我设置firstDayOfWeek: 1(星期一),日历将从星期日更改为星期一,但实际上日历中的天数将保持不变,因此日历是错误的。

你能帮我找出是什么原因造成的吗?
谢谢!
发布于 2020-07-09 09:09:59
我终于解决了,万一别人需要的话。这个问题与moment.js有关。我在下面的代码中使用了以下文档:https://momentjs.com/docs/#/customization/dow-doy/:
moment.updateLocale("en", { week: {
dow: 1, // First day of week is Monday
}});https://stackoverflow.com/questions/62592710
复制相似问题