修复节日计算错误。
This commit is contained in:
@@ -324,15 +324,10 @@ public class Solar{
|
||||
l.add(f);
|
||||
}
|
||||
//计算几月第几个星期几对应的节日
|
||||
//第几周
|
||||
int weekInMonth = calendar.get(Calendar.WEEK_OF_MONTH);
|
||||
int weeks = (int)Math.ceil(day/7D);
|
||||
//星期几,0代表星期天
|
||||
int week = getWeek();
|
||||
//星期天很奇葩,会多算一周,需要减掉
|
||||
if(0==week){
|
||||
weekInMonth--;
|
||||
}
|
||||
f = SolarUtil.WEEK_FESTIVAL.get(month+"-"+weekInMonth+"-"+week);
|
||||
f = SolarUtil.WEEK_FESTIVAL.get(month+"-"+weeks+"-"+week);
|
||||
if(null!=f){
|
||||
l.add(f);
|
||||
}
|
||||
|
||||
@@ -114,6 +114,7 @@ public class SolarUtil{
|
||||
put("10-13",Collections.nCopies(1,"中国少年先锋队诞辰日"));
|
||||
put("10-25",Collections.nCopies(1,"抗美援朝纪念日"));
|
||||
put("11-12",Collections.nCopies(1,"孙中山诞辰纪念日"));
|
||||
put("11-17",Collections.nCopies(1,"国际大学生节"));
|
||||
put("11-28",Collections.nCopies(1,"恩格斯诞辰纪念日"));
|
||||
put("12-1",Collections.nCopies(1,"世界艾滋病日"));
|
||||
put("12-12",Collections.nCopies(1,"西安事变纪念日"));
|
||||
|
||||
Reference in New Issue
Block a user