I want to replace jquery date picker which I have now with this one: https://github.com/T00rk/bootstrap-material-datetimepicker
What I need to change?
In my functions.php is this part of code:

function uep_admin_script_style( $hook ) {
    global $post_type;
if ( 'post.php' == $hook || 'post-new.php' == $hook ) {
    wp_enqueue_script(
        'upcoming-competitions',
        SCRIPTS . 'script.js',
        array( 'jquery', 'jquery-ui-datepicker' ),
        '1.0',
        true
    );

    wp_enqueue_style(
        'jquery-ui-calendar',
        STYLES . 'jquery-ui.css',
        false,
        '1.10.4',
        'all'
    );
}

}
add_action( ‘admin_enqueue_scripts’, ‘uep_admin_script_style’ );

And script.js contain this code
(function( $ ) {

$( '#uep-competition-start-date' ).datepicker({
    dateFormat: 'MM dd, yy',
    onClose: function( selectedDate ){
        $( '#uep-competition-end-date' ).datepicker( 'option', 'minDate', selectedDate );
    }
});
$( '#uep-competition-end-date' ).datepicker({
    dateFormat: 'MM dd, yy',
    onClose: function( selectedDate ){
        $( '#uep-competition-start-date' ).datepicker( 'option', 'maxDate', selectedDate );
    }
});
$( '#uep-competition-entries-deadline' ).datepicker({
    dateFormat: 'MM dd, yy',
    onClose: function( selectedDate ){
        $( '#uep-competition-entries-deadline' ).datepicker( 'option', selectedDate );
    }
});
$( '#uep-class-start-date' ).datepicker({
    dateFormat: 'MM dd, yy',
    onClose: function( selectedDate ){
        $( '#uep-class-start-date' ).datepicker( 'option', selectedDate );
    }
});

})( jQuery );

Read more here: How to use jquery plugin in wordpress


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: