Author Topic: Datepicker  (Read 2399 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Datepicker
« on: January 15, 2019, 03:34:56 pm »
When applying a filter, column using datepicker seems to have defaultDate set to earliest date available currently in grid. Would this be possible to modify to use today's date?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Datepicker
« Reply #1 on: January 15, 2019, 07:43:41 pm »
datepicker defaultDate option can be set with column.filter.dpOptions

https://paramquery.com/pro/api#option-column-filter

http://api.jqueryui.com/datepicker/#option-defaultDate

dpOptions usage is also shown in this example: https://paramquery.com/pro/demos/filter_custom
« Last Edit: January 15, 2019, 07:45:19 pm by paramquery »

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: Datepicker
« Reply #2 on: January 15, 2019, 08:00:32 pm »
Thanks, did try (for todays date):

Code: [Select]
...{ crules: [{ condition: 'between' }], dpOptions: { defaultDate: null } }...
but can't get it to work.
« Last Edit: January 15, 2019, 08:25:29 pm by queensgambit9 »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Datepicker
« Reply #3 on: January 15, 2019, 11:25:27 pm »
Please set { defaultDate: new Date() } instead of null