Django (3.2.9) admin Date Picker not working on Firefox 94

Hello,

I made a simple django model-admin class as follow:


@admin.register(Contract)
class CustomErrorAdmin(FSMTransitionMixin, ImportExportModelAdmin):
    list_display= ('id', 'name', 'client', 'get_users', 'amount',  'signing_date', 'delivery_date', 'notes', 'state', 'created', 'updated')
    # list_filter = ('workerType__workerClass__name', 'workerType__name', 'sex', ('social_security_fund', admin.RelatedOnlyFieldListFilter))
    list_display_links = ('id',)
    filter_horizontal = ('users', )
    list_filter = (('users', admin.RelatedFieldListFilter), ('client', admin.RelatedFieldListFilter), 'state')
    ordering = ('-delivery_date',)
    date_hierarchy= 'delivery_date'
    search_fields=('name', 'notes')
    # inlines = [WorkerHiringInline, DocumentInline, WorkerContactInline]

    fsm_fields = ['state', ]  # list your fsm fields

    list_per_page = 400
    save_as = True
    save_on_top = True

Unfortunatelly the datepicker does not work. I can manually input the date like ‘2021-12-06’ but I cannot use the other functionalitites like today or so.

I error i get from the console is the following:

Uncaught TypeError: window.CalendarNamespace.monthsOfYearAbbrev is undefined
    getAbbrevMonthName http://127.0.0.1:8000/static/admin/js/core.js:91
    strftime http://127.0.0.1:8000/static/admin/js/core.js:102
    handleClockQuicklink http://127.0.0.1:8000/static/admin/js/admin/DateTimeShortcuts.js:224
    addClock http://127.0.0.1:8000/static/admin/js/admin/DateTimeShortcuts.js:116

I’m using the last Django 3.2.9 with Firefox 94.0.

Since it regards Django core components, should I open a ticket for a bug?

Thank you very much for any help.

Carlo

I’ve just tested this using both a standard DateField and a DateTimeField. I’m not seeing any anomalies associated with Firefox 94.0.2.

If I were debugging this, I’d start by examining this situation a lot more closely in terms of the model being used and the Admin mixin classes to ensure there’s no unexpected interaction among them. Mostly, I’d try seeing what I can eliminate until I get to a point where it works.

Also, since all JavaScript executes in the same global environment, I’d check to see if I had other JavaScript code potentially interfering with those core modules.

1 Like

Thank you very much, I removed one mixin (ImportExportModelAdmin) and restored the normal admin.ModelAdmin.

It works correctly now.

Thanks