<div class="form-group"
     {% if visibility %} {{ visibility|safe }} {% endif %}
     >
  <label
    class="control-label {% ifequal style "horizontal" %}col-sm-3{% endifequal %}">
    {{ label }}
  </label>
  <div
    {% ifequal style "horizontal" %}
    class="col-sm-8"
    {% endifequal %}
    >
    {% if user_options %}
      <div class="input-group">
    {% endif %}
        <input type="text" class="form-control"
               uib-datepicker-popup="dd/MM/yyyy"
               ng-model="{{ model }}"
               is-open="{{ formname }}[{{ element_name }} + '_open']"
               min-date="{{ mindate}}"
               max-date="maxDate"
               show-button-bar="false"
               show-weeks="false"
               name="[[ {{ element_name}} ]]"
               datepicker-options="{startingDay: 1}"
               ng-focus="{{ formname }}[{{ element_name }} + '_open']=true"
               close-text="Close"
               {% if change %}
               ng-change="{{ change }}"
               {% endif %}
               {% if required %}
               required
               {% endif %}
               />
     {% if required %}
     <span class="help-block" ng-show="({{ formname }}[{{ element_name }}].$dirty || {{ formname }}.$submitted) && {{ formname }}[{{ element_name }}].$error.required">
        {{ label }} is required
     </span>
     {% endif %}
     {% if user_options %}
         <span class="input-group-btn">
           <button type="button" class="btn btn-default" ng-click="{{ model }} = dateHelper.now()" href="">Today</a>
           <button type="button" class="btn btn-default" ng-click="{{ model }} = dateHelper.yesterday()" href="">Yesterday</a>
         </span>
       </div>
     {% endif %}
  </div>
</div>
