# Django Admin date pickers ignoring FIRST\_DAY\_OF\_WEEK?

**URL:** <https://forum.djangoproject.com/t/django-admin-date-pickers-ignoring-first-day-of-week/38170>\
**Category:** The Admin\
**Created:** [January 23, 2025, 11:55am UTC](https://forum.djangoproject.com/t/django-admin-date-pickers-ignoring-first-day-of-week/38170 "2025-01-23T11:55:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![philgyford](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/philgyford/32/14295_2.png) [@philgyford](https://forum.djangoproject.com/u/philgyford)\
**Post date:** [January 23, 2025, 11:55am UTC](https://forum.djangoproject.com/t/django-admin-date-pickers-ignoring-first-day-of-week/38170/1 "2025-01-23T11:55:32Z")

</div>

I wonder if someone else could see if they have this issue, or whether I’ve set up something wrong.

In `settings.py` I’ve set the [`FIRST_DAY_OF_WEEK` setting](https://docs.djangoproject.com/en/5.1/ref/settings/#first-day-of-week) to be `1`, which is Monday:

```python
FIRST_DAY_OF_WEEK = 1

```

But in the site’s Django Admin, the JS date pickers start the week on Sunday:

 ![Screenshot 2025-01-23 at 11.49.25](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/a/e/aebaa4fe64df266b9280eaae7ee51c50c6b1cb63.png)

I think this was initially fixed in [this issue in 2006](https://code.djangoproject.com/ticket/1061) and an update to the docs about it [in 2011](https://code.djangoproject.com/ticket/15941). So has this regressed since, or is there something else I should be doing regarding internationalisation to get it working?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 23, 2025, 3:58pm UTC](https://forum.djangoproject.com/t/django-admin-date-pickers-ignoring-first-day-of-week/38170/2 "2025-01-23T15:58:59Z")

</div>

From the referenced docs:

> This value is only used when not using format internationalization, or when a format cannot be found for the current locale.

Are either of these conditions true?

---

<div class="post-metadata">

**Author:** ![philgyford](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/philgyford/32/14295_2.png) [@philgyford](https://forum.djangoproject.com/u/philgyford)\
**Post date:** [January 26, 2025, 2:25pm UTC](https://forum.djangoproject.com/t/django-admin-date-pickers-ignoring-first-day-of-week/38170/3 "2025-01-26T14:25:11Z")

</div>

> [@KenWhitesell](#):
>
> Are either of these conditions true?

I don’t know. I have `USE_I18N = False` in my settings. What else should I be looking for?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 26, 2025, 8:47pm UTC](https://forum.djangoproject.com/t/django-admin-date-pickers-ignoring-first-day-of-week/38170/4 "2025-01-26T20:47:50Z")

</div>

`<conjecture>`  
This turns out to be far more interesting than I thought - and may possibly be a documentation issue associated with the changes made for Django 4.0 (See [Django 4.0 release notes | Django documentation | Django](https://docs.djangoproject.com/en/5.1/releases/4.0/#localization))

As you have pointed out above, setting `USE_I18N = False` does not appear to affect the calendar widget in the admin. (I don’t have any idea how it this would affect anything else. I don’t have anything rendering a date that would pay attention to the first day of the week.)

The `get_format` function in `django.utils.formats` still makes a reference to `USE_L10N` and `_USE_L10N_INTERNAL` - neither of which are defined in `django.conf.global_settings` any more.

It now appears that to make this change, you need to supply a custom formats.py file, with the change made inside of _it_. (Adding said formats.py file _does_ change the admin widget, so at least that works.)

The ticket: [#35990 (settings.TIME\_INPUT\_FORMATS never gets used since the removal of USE\_L10N) – Django](https://code.djangoproject.com/ticket/35990) offers the suggestion of using a language that doesn’t have this set, but there is no supplied locale that doesn’t have this defined.

(Also, [Django 5.0 release notes | Django documentation | Django](https://docs.djangoproject.com/en/5.1/releases/5.0/#features-removed-in-5-0) documents that `USE_L10N` has been _removed_, which means the comment made in [#35293 (Django 5.x changes the date format on an \<input type="date"\> from "2012-10-01" to "01/10/2012") – Django](https://code.djangoproject.com/ticket/35293) may not be valid any more.)  
`</conjecture>`

At this point, I think I’ve taken this about as far as I can.

`<opinion>`  
Something doesn’t seem right here - but what to do about it is beyond me.

I think there’s a case that could be made that there’s some work to do in this area. But whether that’s just some documentation cleanup, or actual code changes to the affected functions… 🤷‍♂️  
`</opinion>`

---

<div class="post-metadata">

**Author:** ![philgyford](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/philgyford/32/14295_2.png) [@philgyford](https://forum.djangoproject.com/u/philgyford)\
**Post date:** [January 27, 2025, 9:43am UTC](https://forum.djangoproject.com/t/django-admin-date-pickers-ignoring-first-day-of-week/38170/5 "2025-01-27T09:43:49Z")

</div>

Thanks Ken. I had a poke around the code too but am not much wiser as to where this is going wrong. I created [a ticket](https://code.djangoproject.com/ticket/36145).

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 27, 2025, 12:47pm UTC](https://forum.djangoproject.com/t/django-admin-date-pickers-ignoring-first-day-of-week/38170/6 "2025-01-27T12:47:51Z")

</div>

To add some more for others reading this thread,

`<conjecture>`  
It appears to me that the removal of `USE_L10N` has effectively deactivated settings related to formats that are documented in [Settings | Django documentation | Django](https://docs.djangoproject.com/en/5.1/ref/settings/)

I’ve been unable to find any way to get those settings to directly take effect. (It’s not just the `FIRST_DAY_OF_WEEK` setting - a handful of tickets have been created identifying variations on this basic issue.)  
`</conjecture>`

Assuming the above is correct, I see at least two options:

- Remove those settings from the settings docs, since they don’t do anything when placed in `settings.py`.
- Change the code to allow the settings to “override” or “supersede” what is defined in the `formats.py` file.

`<opinion>`  
Removing the entries from the docs does avoid some confusion. But then the solution of requiring that these settings be changed in individual `formats.py` files feels “unsatisfactory”. (Do I really need to copy / change _all_ the `formats.py` files in `django.conf.locale` if I need this to work across translations?)

I think I’d be more in favor of allowing the `settings.py` entries to override the `formats.py`, but I’m not sure what that would look like in practice.  
`</opinion>`

---

<div class="post-metadata">

**Author:** ![ryanheo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ryanheo/32/8655_2.png) [@ryanheo](https://forum.djangoproject.com/u/ryanheo)\
**Post date:** [February 13, 2025, 8:36am UTC](https://forum.djangoproject.com/t/django-admin-date-pickers-ignoring-first-day-of-week/38170/7 "2025-02-13T08:36:52Z")

</div>

I totally agree with your opinion. Removing the entries from the docs is unsatisfactory and djangonauts may want to customize those settings as well.

On my local, I changed the `get_format` function in the `formats.py`. I use the `settings` from `django.conf` to get the `USE_I18N` from the `settings.py`, and I set `use_l10n` in the `get_format` function as the value of `USE_I18N` when the `use_l10n` is `None`. It changed the `FIRST_DAY_OF_WEEK` when I set `USE_I18N=False`.

```auto
if use_l10n is None:
        use_l10n = getattr(settings, 'USE_I18N')

```

This is my basic idea to fix the issues related to the `USE_L10N` entry for v5.0 or more. But the names do not match each other. I’ll keep my eye on this topic and try to modify/remove the codes related to the `USE_L10N`.
