jquery - 在 jQuery UI Datepicker 中设置一周的开始日期?

标签 jquery jquery-ui

我正在浏览 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/

相关文章:

javascript - 创建长度为 <tr> 的 .row.cells 行

javascript - 找出您刚刚移动的表格的哪一行

jquery - 具有不同 ID 的相同数据的动态选项卡

jquery - 如何完美地居中一个根据用户输入而变化的圆圈

javascript - 如果输入与标签匹配,则停止将无结果标签添加到输入中

jQueryUI .button() 在 Firefox 中打开 ui 对话框后保持按下状态

javascript - 自动选择 html 选择标签的前一个和下一个选项

javascript - Bootstrap 如何在下拉菜单关闭时刷新页面

JavaScript - 从文件夹扫描并创建链接文件

javascript - 跨度 jQuery 的总和