What's the cleanest, simplest-to-get running datepicker in Django?

前端 未结 11 1584
-上瘾入骨i
-上瘾入骨i 2020-12-04 09:37

I love the Thauber Schedule datepicker, but it\'s a datetime picker and I can\'t get it to just do dates. Any recommendations for nice looking datepickers that come with ins

11条回答
  •  一个人的身影
    2020-12-04 09:58

    This is what worked for me . I am using Django 1.11 with bootstrap 3.3 .

    Form.py

    from django.contrib.admin.widgets import AdminDateWidget
    
    class AddInterview(forms.ModelForm):
        class Meta:
            model = models.Interview
            fields = ['candidate', 'date', 'position', 'question_set']
    
        date = forms.DateField(widget=AdminDateWidget())
    

    Template:

        
    {% csrf_token %} {{ form.media }} {{ form.as_p }}

    Note: Date format is yyyy-mm-dd

    CSS: (In same above html template file)

    
    
    
    

    JS:(In same above html template file)

    
    
    
    
    
    
    
    
    

提交回复
热议问题