Opened 12 years ago
Closed 12 years ago
#18976 closed Bug (invalid)
problem with datepicker django widget
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Forms | Version: | 1.4 |
Severity: | Normal | Keywords: | django admin, django jquery, datepicker, DateTimeShortcuts |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
hello,
we have a problem with date picker widget.
We defined form like this :
class GenerateCsvForm(forms.Form): """ Form to get start date and end date. """ start_date = forms.DateField(widget=widgets.AdminDateWidget()) end_date = forms.DateField(widget=widgets.AdminDateWidget())
which is used in template - this is basic page which is positng two dates and show some records.
The problem is that in django 1.3.X it was working well - but after migration to django 1.4 we have a JS problem lile:
Uncaught ReferenceError: django is not defined DateTimeShortcuts.js:205 DateTimeShortcuts.addCalendar DateTimeShortcuts.js:205 DateTimeShortcuts.init DateTimeShortcuts.js:34
Those errors appear on page load - which leads us to point where second date picker is not render.
Note:
See TracTickets
for help on using tickets.
AdminDateWidget
isn't a part of public API, so we can't guarantee it will work outside of the admin app. In this particular case, you don't have a django.jQuery object which is created injquery.init.js
included on every admin page.