Created
October 8, 2019 10:20
-
-
Save LeMiira/91843facb8541718a7b7af6307aa14d1 to your computer and use it in GitHub Desktop.
ACF Pro Datapicker min max date limit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function.php | |
------------------ | |
function my_acf_admin_enqueue_scripts() { | |
// register style | |
wp_register_style( 'my-acf-input-css', get_stylesheet_directory_uri() . '/css/my-acf-input.css', false, '1.0.0' ); | |
wp_enqueue_style( 'my-acf-input-css' ); | |
// register script | |
wp_register_script( 'my-acf-input-js', get_stylesheet_directory_uri() . '/js/my-acf-input.js', false, '1.0.0'); | |
wp_enqueue_script( 'my-acf-input-js' ); | |
} | |
my-acf-input.js | |
------------------ | |
(function ($) { | |
"use strict"; | |
jQuery(document).on("ready", function () { | |
jQuery( '.acf-field-5d9c41399a0fe .acf-date-picker input.input' ).datepicker( 'option', 'maxDate', new Date(2020, 11, 31) ); | |
jQuery( '.acf-field-5d9c41399a0fe .acf-date-picker input.input' ).datepicker( 'option', 'minDate', new Date(2020, 0, 1) ); | |
}) | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment