javascript - Setting defaults for JQuery UI datepicker on whole site -
i'm working site jquery ui datepicker displayed on lot of different pages. have set of features we'd date picker use pages - same date format, same icon, etc.
what's best way set these items default datepicker() function, rather have every call datepicker() include same options? i'm thinking of either somehow modify properties of datepicker() function or create our own function wraps dataepicker() , sets defaults.
you can use $.datepicker.setdefaults()
once in file included on every page (if have main .js
of sort example) runs before .datepicker()
calls, example:
$.datepicker.setdefaults({ dateformat: 'yyyy-mm-dd' })
the options passed in .datepicker()
call.
Comments
Post a Comment