1

I have a date field of a form and I want it to have a format like '21 jan 2020' but I can't find a way to pass it on the selectDate widget

class MemoryForm(ModelForm):

    class Meta:
        model = Memory
        fields = ["date"]
        labels = {"date": ""}
        widgets = {
            'date': SelectDateWidget(attrs={"class": "time", "date_format":'%m/%d/%Y'}),
        }

I've tried others attrs instead of "date_format":'%m/%d/%Y' like "months":'%m' , or "months_field":'%m' but none seemed to work the output was always '21 january 2021'

0 Answers0