zostera / django-bootstrap5

Bootstrap 5 for Django
BSD 3-Clause "New" or "Revised" License
398 stars 88 forks source link

Add datetime-local to the list of supported widgets #678

Open etamponi opened 2 months ago

etamponi commented 2 months ago

Problem

<input type="datetime-local">

This is an HTML5 widget [0], fully supported by Bootstrap, but it is not listed as a supported widget. This causes some issues: for example, I can't use addon_after.

How to fix

Just adding "datetime-local" to FieldRenderer.is_form_control_widget seems to be enough to make it work.

[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local