#35644: `AdminDateWidget` and `AdminTimeWidget` do not have `admin/js/core.js` in
their `Media`
-------------------------------------+-------------------------------------
Reporter: Michał Pokusa | Type:
| Uncategorized
Status: new | Component: Forms
Version: 5.0 | Severity: Normal
Keywords: media, widgets, | Triage Stage:
admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
While developing an extension for Django I noticed that both
`AdminDateWidget` and `AdminTimeWidget` do not have `admin/js/core.js` in
their `Media` nor do they inherit it from any parent class.
The `admin/js/core.js`, specifically the `quickElement` function is used
inside `admin/js/admin/DateTimeShortcuts.js`, which they both reference.
Usually, this is not an issue as `admin/js/core.js` is referenced in
`ModelAdmin.media`, **but nevertheless this seems like it was missed
rather than an intended way**. Other admin widget -
`FilteredSelectMultiple` - references `admin/js/core.js` together with
other scripts needed for it to work.
Wraping it up, I suggest adding `admin/js/core.js` to both
`AdminDateWidget` and `AdminTimeWidget` to unify them with
`FilteredSelectMultiple`.
--
Ticket URL: <
https://code.djangoproject.com/ticket/35644>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.