{% load material_form material_form_internal %}
<div class="row">
    <div id="id_{{ bound_field.html_name }}_container">
        {% part field label %}
        <div class="col s12">
            <label for="{{ bound_field.id_for_label }}" class="{% part field add_label_class %}{{ form_label_class }}{% endpart %}">{{ bound_field.label }}</label>
        </div>
        {% endpart %}
        {% part field prefix %}{% endpart %}
        {% part field control %}
        {% with bound_field|select_date_widget_wrapper as wrapper %}
        {% for select in wrapper.selects %}{% if select.type == "day" %}<div class="col s2">
            <select{% attrs bound_field 'widget_day' %}
                id="id_{{ bound_field.html_name }}_day"
                name="{{ bound_field.html_name }}_day"
                {% if bound_field.errors %}class="invalid"{% endif %}
            {% endattrs %}>{% for value, choice in select.choices %}
                <option {% if value == None or value == '' %}value{% else %}value="{{ value }}"{% endif %}{% if value|force_text == select.value|force_text %} selected="selected"{% endif %}>{% if value == None or value == '' %}{{ form_select_empty_label|default:choice }}{% else %}{{ choice }}{% endif %}</option>{% endfor %}
            </select>
        </div>{% endif %}{% if select.type == "month" %}<div class="col s6">
            <select{% attrs bound_field 'widget_month' %}
                id="id_{{ bound_field.html_name }}_month"
                name="{{ bound_field.html_name }}_month"
                {% if bound_field.errors %}class="invalid"{% endif %}
            {% endattrs %}> {% for value, choice in select.choices %}
                <option {% if value == None or value == '' %}value{% else %}value="{{ value }}"{% endif %}{% if value|force_text == select.value|force_text %} selected="selected"{% endif %}>{% if value == None or value == '' %}{{ form_select_empty_label|default:choice }}{% else %}{{ choice }}{% endif %}</option> {% endfor %}
            </select>
        </div> {% endif %}{% if select.type == "year" %}<div class="col s4">
            <select{% attrs bound_field 'widget_year' %}
                id="id_{{ bound_field.html_name }}_year"
                name="{{ bound_field.html_name }}_year"
                {% if bound_field.errors %}class="invalid"{% endif %}
                      {% endattrs %}>{% for value, choice in select.choices %}
                <option {% if value == None or value == '' %}value{% else %}value="{{ value }}"{% endif %}{% if value|force_text == select.value|force_text %} selected="selected"{% endif %}>{% if value == None or value == '' %}{{ form_select_empty_label|default:choice }}{% else %}{{ choice }}{% endif %}</option>{% endfor %}
            </select>
        </div>{% endif %}
        {% endfor %}{% endwith %}
        <div class="col s12">
        {% part field help_text %}{% if field.help_text %}
            <div class="help-block">{{ bound_field.help_text|safe }}</div>
        {% endif %}{% endpart %}{% part field errors %}
        {% if bound_field.errors %}
        {% include  'material/field_errors.html' %}
        {% endif %}{% endpart %}{{ hidden_initial }}
        {% endpart %}
        </div>
    </div>
</div>
