# Datepicker pre init

**URL:** <https://community.gravityforms.com/t/datepicker-pre-init/9476>\
**Category:** Get Help\
**Tags:** gform\_datepicker\_options\_pre\_init, datepicker\
**Created:** [May 27, 2021, 7:07pm UTC](https://community.gravityforms.com/t/datepicker-pre-init/9476 "2021-05-27T19:07:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![webmgt](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@webmgt](https://community.gravityforms.com/u/webmgt)\
**Post date:** [May 27, 2021, 7:07pm UTC](https://community.gravityforms.com/t/datepicker-pre-init/9476/1 "2021-05-27T19:07:25Z")

</div>

Hi, I use ‘gform\_datepicker\_options\_pre\_init’ to hide certain days on the date picker but it is no longer working, it was before the new update, even tried from the documentation with no luck.

There are no js or console errors. seems like to me the documentation might be slightly out of date for the new data pickers

> **[gform\_datepicker\_options\_pre\_init - Gravity Forms Documentation](https://docs.gravityforms.com/gform_datepicker_options_pre_init/)**
>
> This filter can be used to modify the options used to initialize a fields datepicker.

```
  gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
        if ( formId == 1 && fieldId == 7 ) {
            optionsObj.firstDay = 1;
            optionsObj.beforeShowDay = jQuery.datepicker.noWeekends;
        }
        return optionsObj;
    });
```

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [May 28, 2021, 4:43pm UTC](https://community.gravityforms.com/t/datepicker-pre-init/9476/2 "2021-05-28T16:43:04Z")

</div>

Hi @webmgt - this is the first I heard of it. I recommend opening a support ticket to find out for sure: [https://www.gravityforms.com/support/](https://www.gravityforms.com/support/)

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 5, 2022, 8:34am UTC](https://community.gravityforms.com/t/datepicker-pre-init/9476/3 "2022-01-05T08:34:46Z")

</div>

Closed on January 5, 2022, 8:34am UTC


