我想隐藏datepicker(jquery查询构建器)中的未来日期,如果我设置maxDate: '0'
,则显示未来日期
{
id: 'created_date',
label: 'Date',
type: 'datetime',
validation: {
format: 'YYYY/MM/DD'
},
plugin: 'datepicker',
plugin_config: {
format: 'yyyy/mm/dd',
maxDate: 0,
autoclose: true
},
operators: ['equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', 'is_null', 'is_not_null']
},
如何在查询构建器中隐藏未来日期?
答案 0 :(得分:1)
将maxDate
设置为今天的日期,使用new Date()
,或将maxDate
设置为0将禁用今天日期之后的日期。
如果您特别想隐藏日期,请添加以下CSS
.ui-state-disabled{ visibility:hidden; }
答案 1 :(得分:0)
{
id: 'created_date',
label: 'Date',
type: 'datetime',
validation: {
format: 'YYYY/MM/DD'
},
plugin: 'datepicker',
plugin_config: {
format: 'yyyy/mm/dd',
max:new Date(),
autoclose: true
},
operators: ['equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', 'is_null', 'is_not_null']
},