{% extends "macros.html" %}
{% block html %}
{% if has_is_ended %}
{{input_checkbox(prefix + '_is_ended', initial=False)}}
{% endif %}
{% if is_ended %}
{{input_text(year_name, initial=initial.year, size=4, maxlength=4)}}
{%- if resolution in ['month', 'day', 'hour', 'hh', 'minute', 'second', 'microsecond'] -%}
-
{%- endif -%}
{% if resolution in ['day', 'hour', 'hh', 'minute', 'second', 'microsecond'] -%}
-
{%- endif -%}
{% if resolution in ['hour', 'hh', 'minute', 'second', 'microsecond'] %}
{%- endif -%}
{%- if resolution == 'hh' -%}
:
{%- elif resolution in ['minute', 'second', 'microsecond'] -%}
:
{%- endif -%}
{% if resolution in ['second', 'microsecond'] -%}
:
{%- endif -%}
{% if resolution == 'microsecond' -%}
.{{input_text(microsecond_name, initial="%06d"|format(initial.microsecond), maxlength=6,
pattern='^\\d{6}$', required=True, size=7)}}
{%- endif %}
{% endif %}
{% endblock %}