otto-torino / django-baton

A cool, modern and responsive django admin application based on bootstrap 5 that brings AI to the Django admin - https://baton.sqrt64.it/
MIT License
859 stars 92 forks source link

Date field rendering #277

Closed melicheradam closed 3 months ago

melicheradam commented 7 months ago

Hello, I have a custom form, and I want to render the datetime field just as in a regular admin form.

Desired:

image

start_time = forms.DateTimeField(initial=datetime.now().isoformat(), help_text="Timestamp in ISO 8601 format", required=True, widget=forms.DateTimeInput(attrs={"style": "width: 300px"}))

What im getting:

image

What im getting with SplitDateTimeWidget

image

Any help would be appreciated!

melicheradam commented 7 months ago

Also, in your test app you are using the rangefilter. When I try to use that, I get the following result:

image
list_filter = (
        ("timestamp", DateTimeRangeFilterBuilder()),
        ("timestamp", DateRangeFilter)

    )
abidibo commented 6 months ago

I'm not sure I understood what you asked for

abidibo commented 3 months ago

I'm closing this, feel free to re-open providing more info