2

I'm trying to figure out why I can't have any locale working with monday set as first day of the week.

Installed locales:

francescos@Thinkpad-T420:~$ locale -a
C
C.UTF-8
en_GB.utf8
en_IE.utf8
en_US.utf8
it_IT.utf8
POSIX

and while this looks good:

francescos@Thinkpad-T420:~$ LC_TIME="en_US.UTF-8" cal
    January 2019      
Su Mo Tu We Th Fr Sa  
       1  2  3  4  5  
 6  7  8  9 10 11 12  
13 14 15 16 17 18 19  
20 21 22 23 24 25 26  
27 28 29 30 31    

this one looks weird, as it should start with Monday:

francescos@Thinkpad-T420:~$ LC_TIME="en_IE.UTF-8" cal
    January 2019      
Su Mo Tu We Th Fr Sa  
       1  2  3  4  5  
 6  7  8  9 10 11 12  
13 14 15 16 17 18 19  
20 21 22 23 24 25 26  
27 28 29 30 31 

Final surprise, even this one looks terribly wrong:

francescos@Thinkpad-T420:~$ LC_TIME="it_IT.UTF-8" cal
    Gennaio 2019      
do lu ma me gi ve sa  
       1  2  3  4  5  
 6  7  8  9 10 11 12  
13 14 15 16 17 18 19  
20 21 22 23 24 25 26  
27 28 29 30 31  

I have already checked files @ /usr/share/i18n/locales/, and they look good (like they correctly specify the day the week should start from, Monday=2).

My /etc/default/locale looks like this:

#  File generated by update-locale
LANG=en_IE.UTF-8
LANGUAGE="en_IE:en"
LC_MONETARY=it_IT.UTF-8
LC_MEASUREMENT=it_IT.UTF-8
LC_NUMERIC=it_IT.UTF-8
LC_PAPER=it_IT.UTF-8
LC_TIME=en_IE.UTF-8

and this is the output of "locale -a"

francescos@Thinkpad-T420:~$ locale -a
C
C.UTF-8
en_GB.utf8
en_IE.utf8
en_US.utf8
it_IT.utf8
POSIX
francescos@Thinkpad-T420:~$ locale
LANG=en_IE.utf8
LANGUAGE=en_IE:en
LC_CTYPE="en_IE.utf8"
LC_NUMERIC=it_IT.UTF-8
LC_TIME=en_IE.UTF-8
LC_COLLATE="en_IE.utf8"
LC_MONETARY=it_IT.UTF-8
LC_MESSAGES="en_IE.utf8"
LC_PAPER=it_IT.UTF-8
LC_NAME="en_IE.utf8"
LC_ADDRESS="en_IE.utf8"
LC_TELEPHONE="en_IE.utf8"
LC_MEASUREMENT=it_IT.UTF-8
LC_IDENTIFICATION="en_IE.utf8"
LC_ALL=

I've already re-generated locales and rebooted the system.

3

You need to set your locale to the british one for the time display LC_TIME="en_GB.UTF-8" to get your calendar to start on monday.
You can see the configuration in that post here

Set it in the /etc/default/locale depending on your system. /ect/locale.conf

| improve this answer | |
  • This is a clean way. – GAD3R Feb 6 '19 at 17:52
2

Setting first_weekday in locale

First, determine which time locale is in use. The system wide setting in /etc/default/locale may or may not be overwritten in ~/.pam_environment.

$ cat ~/.pam_environment
…
LC_TIME=en_IE.UTF-8
…

Here, the locale en_IE.UTF-8 appears to be in use. Now, edit the locale source file with administrator privileges. The editor vim is used here, but this can be replaced by, say nano.

$ sudo vim /usr/share/i18n/locales/en_IE

Add the following line right before the END LC_TIME delimiter and save the modified locale source file.

first_weekday  2

Some also suggest adding first_workday 2. However, on my system this was not necessary.

Finally, regenerate the locale files with the following command:

$ sudo locale-gen

Log out and in again for this change to take effect.

| improve this answer | |
0

try cal -m or cal --monday, see man cal

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.