<?php
$min_value = $max_value = "";
if(wcqt_get_value_if_set($input_field, 'time_min_offset', "") != "")
{
	$min_value = $input_field['time_min_offset'] != "" ? str_replace(":",",", date('H:i', strtotime($input_field['time_min_offset']." ".$input_field['time_min_offset_type']))) : ""; 
}
else if(wcqt_get_value_if_set($input_field, 'min_time', "") != "")
{
	$min_value = str_replace(":",",", $input_field['min_time']) ;
}
if(wcqt_get_value_if_set($input_field, 'time_max_offset', "") != "")
{
	$max_value = $input_field['time_max_offset'] != "" ? str_replace(":",",", date('H:i', strtotime($input_field['time_max_offset']." ".$input_field['time_max_offset_type']))) : ""; 
}
else if(wcqt_get_value_if_set($input_field, 'max_time', "") != "")
{
	$max_value = str_replace(":",",", $input_field['max_time']);
}				
?>
<p class="wcqt_input_field_container wcqt_input_time_field_container  wcqt-form-row  wcqt-form-row-<?php echo wcqt_get_value_if_set($input_field, array('position'), "wide") ?>">
	<label class="wcqt_input_field_label <?php echo wcqt_get_value_if_set($input_field, 'required') ? "wcqt_input_field_label_required" : ""; ?>"><?php echo esc_html($input_field['label'][$current_lang]); ?></label>
	<input type="text" 
			name="wcqt-form[<?php echo $input_field_key; ?>]"
			placeholder="<?php echo esc_html(wcqt_get_value_if_set($input_field, array('placeholder', $current_lang), "")); ?>" 
			class="wcqt_input_field wcqt_input_time_field wcqt_input_field_<?php echo $input_field_key; ?>"  
			data-type="time"
			data-required="<?php echo wcqt_get_value_if_set($input_field, 'required', "false") == "true" ? "true" : "false"; ?>"
			data-input-field-id="<?php echo esc_attr($input_field_key); ?>"
			data-min="<?php echo esc_attr($min_value); ?>"
			data-max="<?php echo esc_attr($max_value); ?>"
			data-interval="10"
			value="<?php echo esc_attr($autofill_data["value"]); ?>"
			<?php echo wcqt_get_value_if_set($input_field, 'required') ? "required" : ""; ?>></input>
</p>