<?php

use WpBookingEvent\Factory;
use WpBookingEvent\Utilities\Utility;
use WpBookingEvent\Html\WpBookingEventHtmlBackend as WpBookingEventHtmlBackendAlias;
defined('_WPBOOKINGEVENT_EXEC') or die;
extract($displayData);

WpBookingEventHtmlBackendAlias::load_jquery_library('auto_numeric');

$doc = Factory::getDocument();

$id_by_name = "element_field_". $name;
?>
    <div id="<?php esc_attr_e($id_by_name) ?>" class="field-duration">
        <div class="wrapper-duration">
            <input type="text" value="<?php  esc_attr_e($value) ?>" class="form-control duration">
            <input type="hidden" <?php echo ($required?' required="required" ':'') ?>
                   name="<?php esc_attr_e($name); ?>" value="<?php esc_attr_e($value) ?>">
        </div>
    </div>
<?php
$doc->addScriptApplySelector('#'.$id_by_name,'field_duration',array(
    "input_name"=>  $name,
),'admin/app/layouts/WooBooking/form/field/duration/jquery.duration.js');
