隐藏查询构建器datepicker中的未来日期

问题描述 投票:0回答:2

我想隐藏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']
},

如何在查询生成器中隐藏未来日期?

javascript jquery-query-builder
2个回答
1
投票

maxDate设置为今天的日期,使用new Date(),或将maxDate设置为0将禁用今天日期之后的日期。

如果您特别想隐藏日期,请添加以下CSS .ui-state-disabled{ visibility:hidden; }

小提琴:http://jsfiddle.net/ay100070/


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']
    },
© www.soinside.com 2019 - 2024. All rights reserved.