The datepicker
is working perfect but datetimepicker
is not working at front side in wordpress-4.6.1.
Edit
I have got this in static html using bootstrap-datetimepicker.js
but i don’t want to use this picker in wordpress. I want to achive this only using wordpress datepicker. Is it possible?
HTML
<input type="text" name="date1" id="date1" value="" />
<input type="text" name="datetime" id="datetime" value="" />
wp_enqueue_scripts
add_action('wp_enqueue_scripts', 'custom_datepicker');
function custom_datepicker() {
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_script('jquery-ui-core');
}
JS
add_action('wp_head','custom_header_script');
function custom_header_script() {
?>
<script type="text/javascript">
jQuery(document).ready(function($){
$('#date1').datepicker();
$('#datetime').datepicker({
timeFormat:'hh:mm'
});
});
</script>
<?php
}