diff options
Diffstat (limited to '.config/nvim/lua/leaf/calendar.lua')
| -rw-r--r-- | .config/nvim/lua/leaf/calendar.lua | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/.config/nvim/lua/leaf/calendar.lua b/.config/nvim/lua/leaf/calendar.lua deleted file mode 100644 index f998785..0000000 --- a/.config/nvim/lua/leaf/calendar.lua +++ /dev/null @@ -1,43 +0,0 @@ -local M = {} - - -local floor = math.floor - - -M.MON = 1 -M.TUE = 2 -M.WED = 3 -M.THU = 4 -M.FRI = 5 -M.SAT = 6 -M.SUN = 7 - - -function M.calc_week_of_day(y, m, d) - -- Zeller's congruence - if m == 1 or m == 2 then - m = m + 12 - y = y - 1 - end - local C = floor(y / 100) - local Y = y % 100 - local G = 5*C + floor(C/4) - return 1 + (d + floor(26 * (m+1) / 10) + Y + floor(Y/4) + G + 5) % 7 -end - - -function M.translate_week_of_day(w, locale) - -- assert(locale == 'ja_JP') - return ({ - [M.MON] = '月', - [M.TUE] = '火', - [M.WED] = '水', - [M.THU] = '木', - [M.FRI] = '金', - [M.SAT] = '土', - [M.SUN] = '日', - })[w] -end - - -return M |
