| 236 | // Localized jQuery UI datepicker |
| 237 | global $wp_locale; |
| 238 | |
| 239 | $datepicker_args = array( |
| 240 | 'jqueryUiDatepicker' => array( |
| 241 | 'closeText' => esc_js( __( 'Close' ) ), |
| 242 | 'currentText' => esc_js( __( 'Today' ) ), |
| 243 | 'monthNames' => array_values( $wp_locale->month ), |
| 244 | 'monthNamesShort' => array_values( $wp_locale->month_abbrev ), |
| 245 | 'monthStatus' => esc_js( __( 'Show a different month' ) ), |
| 246 | 'nextText' => esc_js( __( 'Next' ) ), |
| 247 | 'prevText' => esc_js( __( 'Previous' ) ), |
| 248 | 'dayNames' => array_values( $wp_locale->weekday ), |
| 249 | 'dayNamesShort' => array_values( $wp_locale->weekday_abbrev ), |
| 250 | 'dayNamesMin' => array_values( $wp_locale->weekday_initial ), |
| 251 | 'dateFormat' => esc_js( get_option( 'date_format' ) ), |
| 252 | 'firstDay' => absint( get_option( 'start_of_week' ) ), |
| 253 | 'isRTL' => $wp_locale->is_rtl(), |
| 254 | ), |
| 255 | ); |
| 256 | |
| 257 | $scripts->localize( 'jquery-ui-datepicker', 'wpl10n', $datepicker_args ); |
| 258 | |
| 259 | $localized_datepicker = 'jQuery(document).ready(function(jQuery) { jQuery.datepicker.setDefaults(wpl10n.jqueryUiDatepicker); });'; |
| 260 | $scripts->add_inline_script( 'jquery-ui-datepicker', $localized_datepicker ); |
| 261 | |