我想用这个替换我现在拥有的jquery日期选择器:https://github.com/T00rk/bootstrap-material-datetimepicker我需要改变什么?
在我的functions.php
这是代码的一部分:
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\' );
和脚本。js包含此代码
(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 );