#36145: FIRST_DAY_OF_WEEK setting not changing the Admin calendar widget
-------------------------------+------------------------------------
     Reporter:  Phil Gyford    |                    Owner:  (none)
         Type:  Bug            |                   Status:  new
    Component:  contrib.admin  |                  Version:  5.1
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+------------------------------------
Comment (by Ryan Heo):

 {{{
         """
         The active locale's formats take precedence over the default
 settings
         even if they would be interpreted as False in a conditional test
         (e.g. 0 or empty string) (#16938).
         """
 }}}

 I found the test code for the 'FIRST_DAY_OF_WEEK' attribute in
 tests>i18n>tests.py line 697.
 It says that locale's formats take precedence over the default settings.
 When I checked with several locale's formats files, I found that some of
 them have the 'FIRST_DAY_OF_WEEK' attribute while others don't have it.
 Since the locale's formats take precedence, you can't change the
 'FIRST_DAY_OF_WEEK' attribute if the locale's file has it.
 If it doesn't have the attribute, such as LANGUAGE_CODE = 'ko,' you can
 simply change it in the settings.py.

 Now I have found a bug. On the documentation, it says the following.
     **FIRST_DAY_OF_WEEK**
     A number representing the first day of the week. This is especially
 useful when displaying a calendar. This value is only used when not using
 format internationalization, or when a format cannot be found for the
 current locale.

 When I used USE_I18N=False, I couldn't use the FIRST_DAY_OF_WEEK as I
 wanted.
 I think this is because 'USE_L10N' was removed from v5.0 but is still used
 in the 'get_format' function in django>utils>formats.py rather than
 use_i18n.
 I will keep working on this issue to remove the use_l10n part from the
 get_format and follow the current documentation.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36145#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070194dcf52c7f-30c3a98d-cc2d-417c-8296-7525cb711504-000000%40eu-central-1.amazonses.com.

Reply via email to