Skip to content

Instantly share code, notes, and snippets.

@buzztaiki
Created September 12, 2021 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buzztaiki/d8f7470c2fa3b21926a3ec4326757ea8 to your computer and use it in GitHub Desktop.
Save buzztaiki/d8f7470c2fa3b21926a3ec4326757ea8 to your computer and use it in GitHub Desktop.
Linux のカレンダーで週の最初を月曜日にする

Linux のカレンダーで週の最初を月曜日にする

Gnome のカレンダーや util-linuxcal コマンドは週の始まりを locale の設定に従って決めているので、週の始まりを決める個別の設定は存在しない。

/etc/locale.conf や環境変数では「どの国の」基準に従うといった設定しかできないので、標準外の設定をしたい場合はシステム管理のファイルを変えないといけない。

変える場合は /usr/share/i18n/locales/ja_JPLC_TIME に以下を追加する:

first_weekday 2

その後 localegen を実行する。

man page から引用:

https://man.archlinux.org/man/locale.5

first_weekday (since glibc 2.2) followed by the number of the day from the day list to be shown as the first day of the week in calendar applications. The default value of 1 corresponds to either Sunday or Monday depending on the value of the second week list item. See NOTES.

first_workday (since glibc 2.2) followed by the number of the first working day from the day list. The default value is 2. See NOTES.

NOTES For compatibility reasons, ... set first_weekday and first_workday to 1 or 2, depending on whether the week and work week actually starts on Sunday or Monday for the locale.

ついでに Wikipedia からも引用:

https://ja.wikipedia.org/wiki/曜日#週の始まり

日本では諸法令や民間において日曜日始まりと月曜日始まりが混在している。

かなしい。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment