ビルドインの calendar.el
にある calendar-intermonth-text
をカスタマイズすると,カレンダーに週番号を表示させることが可能.ただ, calendar.el
に記載されている例だと, calendar-week-start-day
が 1
以外の時に計算結果がおかしくなる.
次のように calendar-absolute-from-gregorian
に渡す値を補正するとうまくいく.
(setq calendar-intermonth-text
'(propertize
(format "%02d"
(car
(calendar-iso-from-absolute
(calendar-absolute-from-gregorian
(list month (- day (1- calendar-week-start-day)) year)))))
'font-lock-face 'calendar-iso-week-face))
see also
- http://www.emacswiki.org/emacs/CalendarWeekNumbers
- http://stackoverflow.com/questions/21364948/how-to-align-the-calendar-with-week-number-as-the-intermonth-text
- https://blogs.msdn.microsoft.com/shawnste/2006/01/24/iso-8601-week-of-year-format-in-microsoft-net/
- https://discussions.apple.com/thread/7179260?start=0&tstart=0
- http://www.h3.dion.ne.jp/~sakatsu/Excel_Tips20.htm