2

As per the classes option guide here, I tried to overwrite the default classes used by jQuery ui datepicker.

The datepicker doesn't have a .prototype, like the other widgets, so $.ui.datepicker.prototype is undefined.

I've tried to specify classes option for each .datepicker instance like so:

$('.datepicker_selector').datepicker({ 
    classes: { "ui-datepicker": "custom_class_name" },
...

but with no success.

I've opened a ticket at the jQuery ui git repo, I'm wondering if anyone has solved this? (The datepicker works fine, no errors in console either).

Thank you for your feedback!

6
  • Possible solution is to use beforeShow, I'm aware of that
    – lehel
    Commented Nov 28, 2017 at 13:08
  • 2
    A possible start: jsfiddle.net/Twisty/ofkude4b/1
    – Twisty
    Commented Nov 29, 2017 at 7:10
  • Thanks Twisty, I gave up and used beforeShow - as it seems, no other option is available for the datepicker.
    – lehel
    Commented Nov 29, 2017 at 9:59
  • Yes this is the case due to it's more dynamic nature.
    – Twisty
    Commented Nov 29, 2017 at 15:01
  • unfortunately, beforeShow is not called when using the datepicker inline (on a div, not on an input)
    – Bob S
    Commented Feb 4, 2019 at 9:02

0