update
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{% macro datetime_picker_field(label, name, value='', field_id=None, required=False, wrapper_class='', wrapper_id=None, label_id=None, button_label='选择') %}
|
||||
{% set display_value = value|replace('-', '/')|replace('T', ' ') if value else '' %}
|
||||
{% set picker_id = (field_id or name) ~ '-picker' %}
|
||||
<label class="mission-datetime-control {{ wrapper_class }}"{% if wrapper_id %} id="{{ wrapper_id }}"{% endif %}>
|
||||
<span class="field-label"{% if label_id %} id="{{ label_id }}"{% endif %}>{{ label }}</span>
|
||||
<div class="mission-datetime-control-row" data-datetime-control>
|
||||
<input class="mission-datetime-display-input" type="text" name="{{ name }}" value="{{ display_value }}" placeholder="YYYY/MM/DD HH:MM" autocomplete="off"{% if field_id %} id="{{ field_id }}"{% endif %}{% if required %} required{% endif %}>
|
||||
<input class="mission-datetime-picker-proxy" type="datetime-local" value="{{ value }}" id="{{ picker_id }}" tabindex="-1" aria-hidden="true">
|
||||
<button class="secondary-button mission-datetime-picker-button" type="button" data-datetime-picker-target="{{ picker_id }}">{{ button_label }}</button>
|
||||
</div>
|
||||
</label>
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user