Skip to content

Instantly share code, notes, and snippets.

@pavelrich
Last active October 21, 2021 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavelrich/afce0520ea69878e4097460c00517fe3 to your computer and use it in GitHub Desktop.
Save pavelrich/afce0520ea69878e4097460c00517fe3 to your computer and use it in GitHub Desktop.
FORQY — Custom Settings of the jQuery UI Datepicker — Disable selection of today
<?php
if ( ! function_exists( 'prefix_scripts_datepicker' ) ) {
/**
* Custom Settings of the jQuery UI Datepicker
*/
function prefix_scripts_datepicker() {
$datepicker = '
(function ($) {
"use strict";
// Disable selection of today
$(".js-datepicker").datepicker("option", "minDate", 1);
}(jQuery));
';
wp_add_inline_script( 'jquery-ui-datepicker', $datepicker );
}
add_action( 'wp_enqueue_scripts', 'prefix_scripts_datepicker', 90 );
}
@TP18
Copy link

TP18 commented Mar 25, 2021

hi Pavel. Any advice on getting the datepicker to work again on linguni theme? The dates don't pop up and our customers cant select a date. TypeError: undefined is not a function (near '...$('.js-datepicker').datepicker...')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment