0

I would like to hide future date in datepicker(jquery query builder),if I set maxDate: '0',future date are shown

{
    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']
},

How can I hide future date in query builder?

Sibeesh Venu
  • 18,755
  • 12
  • 103
  • 140
ranga s
  • 19
  • 1

2 Answers2

1

Set maxDate as today's date, by using new Date(), or setting maxDate to 0 will disable the dates after todays date.

If you specifically want to hide the date, Add the following CSS .ui-state-disabled{ visibility:hidden; }

Fiddle: http://jsfiddle.net/ay100070/

DesTroy
  • 390
  • 4
  • 17
  • @rangas added Fiddle with example to hide the disabled dates. – DesTroy Aug 14 '17 at 11:48
  • @Ashish Don't give solution such kind of people who have not even find this kind of easy solution from internet. this is common usage and anyone can very easily find the solution. We are not here to give quick solution of this kind stuff or helping out of them. – Yagnik Detroja Aug 14 '17 at 11:54
  • @YagnikDetroja, "We are not here to give quick solution of this kind stuff or helping out of them." this is exactly why stackoverflow is, I did what I had to do, now keep this "People should do things themselves because everyone is as smart as I am and they shouldn't ask for help" to yourself. – DesTroy Aug 14 '17 at 11:59
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']
    },
chrisis
  • 1,983
  • 5
  • 20
  • 17