Thanks alot for the quick reply David.
It’s no problem for me to enque it for that page, and yes it’s for a plugin and option page.
So what I’ve done is just to include this:
function load_custom_admin_scripts() {
wp_enqueue_style( 'fib-css', plugins_url() . '/fib-plugin/css/style.css' );
wp_enqueue_script( 'jquery-validate', plugins_url() . '/fib-plugin/js/jquery.validate.min.js', array(), '1.0.0', true );
wp_enqueue_script( 'fib-scripts', plugins_url() . '/fib-plugin/js/scripts.js', array(), '1.0.0', true );
}
add_action( 'admin_enqueue_scripts', 'load_custom_admin_scripts' );
And in the your plugins option page I wrote the code:
jQuery(document).ready(function($) {
var dateToday = new Date();
$( "#datepicker" ).datepicker({
monthNames: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
dayNames: [ "S?ndag", "M?ndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "L?rdag" ],
dayNamesMin: [ "S?", "M?", "Tis", "Ons", "Tors", "Fre", "L?" ],
dateFormat: "yy-mm-dd",
firstDay: 1,
minDate: dateToday
});
});
So should this be working if I just add the CSS above? Because right now it’s not, nothing happens when the #datepicker input is being clicked. Or do I have to put the code to initiate somewhere else instead?
BR / Niko