I looked in the PODS source and found out how it works. First load the proper scripts:
/**
* Load Timepicker add-on
*
*
*
*/
if ( ! wp_script_is( 'jquery-ui-slideraccess', 'registered' ) ) {
// No need to add dependencies. All managed by jquery-ui-timepicker.
wp_register_script( 'jquery-ui-slideraccess', trailingslashit( plugin_dir_url( __DIR__ ) ) . 'pods/ui/js/timepicker/jquery-ui-sliderAccess.js', array(), '0.3' );
}
if ( ! wp_script_is( 'jquery-ui-timepicker', 'registered' ) ) {
wp_register_script(
'jquery-ui-timepicker', trailingslashit( plugin_dir_url( __DIR__ ) ) . 'pods/ui/js/timepicker/jquery-ui-timepicker-addon.min.js', array(
'jquery',
'jquery-ui-core',
'jquery-ui-datepicker',
'jquery-ui-slider',
'jquery-ui-slideraccess',
), '1.6.3'
);
}
if ( ! wp_style_is( 'jquery-ui-timepicker', 'registered' ) ) {
wp_register_style( 'jquery-ui-timepicker', trailingslashit( plugin_dir_url( __DIR__ ) ) . 'pods/ui/js/timepicker/jquery-ui-timepicker-addon.min.css', array(), '1.6.3' );
}
wp_enqueue_script('jquery-ui-timepicker');
wp_enqueue_style( 'jquery-ui-custom', trailingslashit( plugin_dir_url( __DIR__ ) ) . 'pods/ui/css/smoothness/jquery-ui.custom.css' );
wp_enqueue_style( 'jquery-ui-timepicker' );
Then engage with ie
$('#basic_example_1').datetimepicker();
-
This reply was modified 7 years, 4 months ago by
baggadap.
Plugin Contributor
pglewis
(@pglewis)
This will work for now and is the info I was going to include for you before you did the legwork yourself.
Be advised that Gutenberg has a react-based DateTime component and we will almost certainly be switching to that for 2.8. I need to dig up the GH issue they had for that new-ish component, last I looked several weeks back they had a lot of things to do still.
wordpress.org/gutenberg/handbook/components/date-time/
-
This reply was modified 7 years, 4 months ago by
pglewis.
-
This reply was modified 7 years, 4 months ago by
pglewis.
-
This reply was modified 7 years, 4 months ago by
pglewis.