django-bootstrap4 icon indicating copy to clipboard operation
django-bootstrap4 copied to clipboard

how to have datepicker

Open sant527 opened this issue 3 years ago • 1 comments

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 %}

sant527 avatar May 10 '21 11:05 sant527

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.

christianwgd avatar May 16 '21 15:05 christianwgd