• R/O
  • SSH
  • HTTPS

protra: Commit


Commit MetaInfo

Revision542 (tree)
Time2019-03-09 11:15:29
Authordarai

Log Message

2019-03-09 darai <darai@users.sourceforge.jp>

#38858: 新しい元号への対応

* Protra.Lib/Calendar.cs (Calendar.IsHoliday): 新しい元号への対応。

Change Summary

Incremental Difference

--- protra/trunk/ChangeLog.txt (revision 541)
+++ protra/trunk/ChangeLog.txt (revision 542)
@@ -1,3 +1,9 @@
1+2019-03-09 darai <darai@users.sourceforge.jp>
2+
3+ #38858: 新しい元号への対応
4+
5+ * Protra.Lib/Calendar.cs (Calendar.IsHoliday): 新しい元号への対応。
6+
17 2018-12-24 panacoran <panacoran@users.osdn.me>
28
39 セキュリティプロトコルの指定は不要なので削除する
--- protra/trunk/Protra.Lib/Calendar.cs (revision 541)
+++ protra/trunk/Protra.Lib/Calendar.cs (revision 542)
@@ -64,12 +64,26 @@
6464 (d.Month == 2 && d.Day == 11) ||
6565 (d.Month == 4 && d.Day == 29) ||
6666 (d.Month == 5 && (d.Day >= 3 && d.Day <= 5)) ||
67- (d.Month == 11 && (d.Day == 3 || d.Day == 23)) ||
68- (d.Month == 12 && d.Day == 23))
67+ (d.Month == 11 && (d.Day == 3 || d.Day == 23))
68+ )
6969 return true;
7070 // 山の日
7171 if (d.Year >= 2016 && d.Month == 8 && d.Day == 11)
7272 return true;
73+ // 天皇誕生日
74+ if (d.Year <= 2018 && d.Month == 12 && d.Day == 23)
75+ return true;
76+ if (d.Year >= 2020 && d.Month == 2 && d.Day == 23)
77+ return true;
78+ // 2019新天皇即位に伴う休日
79+ if (d.Year == 2019)
80+ {
81+ if (d.Month == 4 && d.Day == 30) return true;
82+ if (d.Month == 5 && d.Day == 1) return true;
83+ if (d.Month == 5 && d.Day == 2) return true;
84+ if (d.Month == 10 && d.Day == 22) return true;
85+ }
86+
7387 // 春分と秋分(1980〜2099年に対応)
7488 if (d.Month == 3 &&
7589 // ReSharper disable PossibleLossOfFraction
Show on old repository browser