django-bootstrap4
django-bootstrap4 copied to clipboard
how to have datepicker
class MaterialRequest(models.Model):
material_name = models.CharField(max_length = 50)
quantity = models.FloatField()
date_required_by = models.DateTimeField()
and
class MaterialRequestForm(forms.ModelForm):
class Meta:
model = MaterialRequest
how to add datepicker
template
{% csrf_token %}
{% bootstrap_form form %}
Hey, django-bootstrap4 doesn't provide special widgets, that are not part of bootstrap. But there are some packages that provide date- and time-pickers. Have a look at https://github.com/monim67/django-bootstrap-datepicker-plus. There is also this package https://github.com/FlipperPA/django-tempus-dominus, but this seems to be no longer maintained. I'm sure there are a lot more, all with pros and cons.