Django 1.8 & Django Crispy Forms: Is there a simple, easy way of implementing a Date Picker?

前端 未结 4 1997
逝去的感伤
逝去的感伤 2021-02-07 13:41

There are an awful lot of date/datetime picker implementations out there. Are there any that integrate with Django and Crispy Forms particularly well, and how are they used?

4条回答
  •  囚心锁ツ
    2021-02-07 13:45

    django.forms.SelectDateWidget is simple and flexible:

    date_field = forms.DateField(
        widget=forms.SelectDateWidget(years, months, empty_label)
    )
    

    It even includes its own template file.

提交回复
热议问题