<script>
    $(function () {
        $('.datepicker').datepicker({
            showOn: "button",
            dateFormat: lang.date_js_format,
            showAlways: true,
            buttonImage: "images/calbtn.png",
            buttonImageOnly: true,
            buttonText: "Calendar",
            showAnim: (('\v' == 'v') ? "" : "show")  // в ie не включаем анимацию, тормозит
        }).attr('placeholder', lang.date_placeholder);
    });
</script>
<div class="correlation__row">
    <div class="correlation__key">
        {$base_params['description']}<span class="help_bt" h_id="{$base_params['help']}"></span>:
    </div>
    <div style="text-align: left; padding: 3px;">
        {if $base_params['cond'] == true}
            <select id="{$base_params['name']}_{$tpl_num}_sel" name="calc_params[{$tpl_num}][{$base_params['name']}][cond]" onchange="date_cond($(this), $('#{$base_params["name"]}_{$tpl_num}_date2'));" class="form-control form-control-100 dont_use_chosen">
                <option value="=" {if $base_params['set_params']['cond'] == '='}selected{/if}>{$lang['=']}</option>
                <option value="!=" {if $base_params['set_params']['cond'] == '!='}selected{/if}>{$lang['!=']}</option>
                <option value="period" {if  $base_params['set_params']['cond'] == 'period'}selected{/if}>{$lang.period}</option>
            </select>
            <span id="{$base_params['name']}_{$tpl_num}_date1"><input name="calc_params[{$tpl_num}][{$base_params['name']}][date1]" value="{$base_params['set_params']['date1']}" size="5"
                                                           class="datepicker form-control form-control-100"/></span>
            <span id="{$base_params['name']}_{$tpl_num}_date2"> - <input name="calc_params[{$tpl_num}][{$base_params['name']}][date2]"  value="{$base_params['set_params']['date2']}" size="5"
                                                           class="datepicker form-control form-control-100"/></span>
            <script>date_cond($('#{$base_params["name"]}_{$tpl_num}_sel'), $('#{$base_params["name"]}_{$tpl_num}_date2'))</script>
        {else}
            <span id="{$base_params['name']}_{$tpl_num}_date1"><input name="calc_params[{$tpl_num}][{$base_params['name']}][date1]" value="{$base_params['set_params']['date1']}" size="5"
                                                           class="datepicker form-control form-control-100"/></span>
        {/if}
    </div>
</div>