[Django]-How to put placeholder in Django date range filter

8๐Ÿ‘

โœ…

You can assign a placeholder like it is done with an ordinary django form

class AdvancedSearchInboxFilter(django_filters.FilterSet):
    received = django_filters.DateFromToRangeFilter(
        label='Received Date Range',
        widget=django_filters.widgets.RangeWidget(attrs={'placeholder': 'yyyy/mm/dd'}))

    class Meta:
        model = File
        fields = ['received']
๐Ÿ‘คv1k45

Leave a comment