This commit is contained in:
Looly 2020-10-31 10:30:46 +08:00
parent 4f37753b91
commit 6674dcbde7
2 changed files with 11 additions and 12 deletions

View File

@ -165,7 +165,7 @@ public enum Month {
/**
* 获得指定月的最后一天
* @param month 月份
* @param month 月份从0开始
* @param isLeapYear 是否为闰年闰年只对二月有影响
* @return 最后一天可能为28,29,30,31
* @since 5.4.7

View File

@ -9,7 +9,6 @@ import java.util.List;
* 考虑每月的天数不同且存在闰年情况日匹配单独使用
*
* @author Looly
*
*/
public class DayOfMonthValueMatcher extends BoolArrayValueMatcher {
@ -28,7 +27,7 @@ public class DayOfMonthValueMatcher extends BoolArrayValueMatcher {
* 给定的日期是否匹配当前匹配器
*
* @param value 被检查的值此处为日
* @param month 实际的月份
* @param month 实际的月份从1开始
* @param isLeapYear 是否闰年
* @return 是否匹配
*/
@ -46,11 +45,11 @@ public class DayOfMonthValueMatcher extends BoolArrayValueMatcher {
* </pre>
*
* @param value 被检查的值
* @param month 月份
* @param month 月份从1开始
* @param isLeapYear 是否闰年
* @return 是否为本月最后一天
*/
private static boolean isLastDayOfMonth(int value, int month, boolean isLeapYear) {
return value == Month.getLastDay(month, isLeapYear);
return value == Month.getLastDay(month - 1, isLeapYear);
}
}