<?php

/**
 * Date picker input
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $wpcb_field;

echo'<input id="' . esc_attr( $wpcb_field_id ) . '" name="' . esc_attr( wpcb_sanitize_title( $wpcb_field['field']['label'] ) ) . '" type="text"';
if ( isset( $wpcb_field['field']['date_inline'] ) && 'yes' === $wpcb_field['field']['date_inline'] ) {
	echo ' data-date-inline="yes"';
}
wpcb_display_field_attributes( $wpcb_field );
echo ' autocomplete="off" />';

echo wp_kses( wpcb_get_icon('date'), wpcb_get_icon_kses_args() );

if ( isset( $wpcb_field['field']['date_inline'] ) && 'yes' === $wpcb_field['field']['date_inline'] ) {
	echo '<div class="wpcb-datepicker-inline"></div>';
}
