Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to have datepicker #294

Open
sant527 opened this issue May 10, 2021 · 1 comment
Open

how to have datepicker #294

sant527 opened this issue May 10, 2021 · 1 comment

Comments

@sant527
Copy link

sant527 commented May 10, 2021

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 %}
@christianwgd
Copy link

christianwgd commented May 16, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants