widgets: display formatted date in readonly fields (#42027)
This commit is contained in:
parent
d15bef1e53
commit
403cee7354
|
@ -5,8 +5,11 @@
|
|||
type="{% if "readonly" in widget.attrs %}text{% else %}date{% endif %}"
|
||||
{% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}"{% endfor %}
|
||||
{% if widget.required %}aria-required="true"{% endif %}
|
||||
{% if "readonly" in widget.attrs %}
|
||||
{% if widget.value %}value="{{ widget.value }}"{% endif %}
|
||||
{% else %}
|
||||
|
||||
{% if widget.value %}value="{{ widget.value|date:"Y-m-d" }}" data-formatted-value="{{ widget.value }}"{% endif %}
|
||||
{% if not "readonly" in widget.attrs %}
|
||||
class="date-pick"
|
||||
data-date-format="{{widget.date_format}}"
|
||||
|
||||
|
|
Loading…
Reference in New Issue