使用 windows 日曆,想顯示農曆日期。
獲取節日
從 http://www.google.com/calendar/ical/china__zh_cn%40holiday.calendar.google.com/public/basic.ics 獲取谷歌提供的中國節日,但是沒有農曆。
獲取農曆
使用 LunariCal 生成農曆 ics 文件。
在 Windows 日曆中,單擊工具欄的“訂閱”按鈕,在彈出的“訂閱日曆”窗口的“要訂閱的日曆“文本框中指定剛纔生成的 ics 文件,但是報錯。
翻到 https://github.com/infinet/lunar-calendar,提供有去年、今年、明年共三年的農曆 ics 文件:chinese_lunar_prev_year_next_year.ics,下載下來就可以使用。
文中提到程序的 python 版速度較慢,另外提供快速的 c 語言版本。
那就試試在 windows 下自己編譯個 exe。
嘗試過 Dev CPP 和 Code::Blocks ,都無法直接 make。
從 https://github.com/babun/babun 獲取 babun,提供 windows 下的 bash 和 zsh(默認),安裝提供的 2015 年版本,發現自帶 git 2.1.4 / python 2.7 / perl 5.14 / cc 4.9.2。
在 babun 下直接 make,成功得到可執行文件,但在運行時需要複製 cygwin1.dll 到 lunarcal.exe 所在目錄。
本文提要
1、window 日曆下如何更新 ics。
2、在 windows 下 make 下 linux 程序,一步得到可執行文件。
3、獲取農曆 ics 文件。