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

前端 未结 4 2008
逝去的感伤
逝去的感伤 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 14:09

    Not an answer for a crispy forms but newer browsers will put in a date picker for you as long as the input has an attribute type of date. This falls into the category of minimal development effort.

    date_field = forms.DateField(
        widget=forms.TextInput(     
            attrs={'type': 'date'} 
        )
    )                                           
    

提交回复
热议问题