我正在浏览 jQuery UI Datepicker ( http://jqueryui.com/demos/datepicker/ ) 的文档,但我找不到如何将一周的第一天设置为星期一。
应用区域设置会将星期一设置为一周的第一天,但这也会更改语言。
最佳答案
这是我使用的示例配置。查看最后一行“firstDay: 1”。 我认为使用像这样的语法来指定日期选择器选项看起来更好;)
$('#datepickerfield').datepicker({
constrainInput: true, // prevent letters in the input field
minDate: new Date(), // prevent selection of date older than today
showOn: 'button', // Show a button next to the text-field
autoSize: true, // automatically resize the input field
altFormat: 'yy-mm-dd', // Date Format used
beforeShowDay: $.datepicker.noWeekends, // Disable selection of weekends
firstDay: 1 // Start with Monday
})
关于jquery - 在 jQuery UI Datepicker 中设置一周的开始日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1313317/