diff --git a/common/php/class-module.php b/common/php/class-module.php index 5bd251057..0d7231d66 100644 --- a/common/php/class-module.php +++ b/common/php/class-module.php @@ -205,14 +205,12 @@ function filter_posts_link( $slug, $post_type = 'post' ) { */ function enqueue_datepicker_resources() { - // Add the first day of the week as an available variable to wp_head - echo ""; - wp_enqueue_script( 'jquery-ui-datepicker' ); //Timepicker needs to come after jquery-ui-datepicker and jquery wp_enqueue_script( 'edit_flow-timepicker', EDIT_FLOW_URL . 'common/js/jquery-ui-timepicker-addon.js', array( 'jquery', 'jquery-ui-datepicker' ), EDIT_FLOW_VERSION, true ); wp_enqueue_script( 'edit_flow-date_picker', EDIT_FLOW_URL . 'common/js/ef_date.js', array( 'jquery', 'jquery-ui-datepicker', 'edit_flow-timepicker' ), EDIT_FLOW_VERSION, true ); + wp_add_inline_script( 'edit_flow-date_picker', sprintf( 'var ef_week_first_day = %s;', wp_json_encode( get_option( 'start_of_week' ) ) ), 'before' ); // Now styles wp_enqueue_style( 'jquery-ui-datepicker', EDIT_FLOW_URL . 'common/css/jquery.ui.datepicker.css', array( 'wp-jquery-ui-dialog' ), EDIT_FLOW_VERSION, 'screen' );