{% load i18n %}
{% load cradmin_icon_tags %}

<div id="id_cradmin_{{ classname_lower }}_{{ fieldname }}"
     class="django-cradmin-datepicker {{ extra_css_classes }}">
    {{ field|safe }}
    <p class="django-cradmin-datepicker-preview-and-button-para">
        <span id="{{ previewid }}" class="django-cradmin-datepicker-preview">
            {# Contents is added by the AngularJS directive #}
        </span>
        <button type="button"
                id="{{ triggerbuttonid }}"
                class="btn btn-default django-cradmin-datepicker-triggerbutton">
            {# Label is added by the AngularJS directive #}
        </button>
    </p>
    <div django-cradmin-datetime-selector='{{ datepicker_config|safe }}'></div>

    <script id="{{ previewtemplateid }}" type="text/x-angularjs-template">
        {{ preview_angularjs_template|safe }}
    </script>
</div>

<button type="button"
        django-cradmin-setfieldvalue="2015-12-24 12:30"
        django-cradmin-setfieldvalue-field-id="{{ fieldid }}">
    Set value to 2015-12-24 12:30
</button>
