mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix test
This commit is contained in:
parent
4f37753b91
commit
6674dcbde7
@ -165,7 +165,7 @@ public enum Month {
|
||||
|
||||
/**
|
||||
* 获得指定月的最后一天
|
||||
* @param month 月份
|
||||
* @param month 月份,从0开始
|
||||
* @param isLeapYear 是否为闰年,闰年只对二月有影响
|
||||
* @return 最后一天,可能为28,29,30,31
|
||||
* @since 5.4.7
|
||||
|
@ -7,17 +7,16 @@ import java.util.List;
|
||||
/**
|
||||
* 每月第几天匹配<br>
|
||||
* 考虑每月的天数不同,且存在闰年情况,日匹配单独使用
|
||||
*
|
||||
* @author Looly
|
||||
*
|
||||
* @author Looly
|
||||
*/
|
||||
public class DayOfMonthValueMatcher extends BoolArrayValueMatcher {
|
||||
|
||||
private static final int[] LAST_DAYS = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
private static final int[] LAST_DAYS = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param intValueList 匹配的日值
|
||||
*/
|
||||
public DayOfMonthValueMatcher(List<Integer> intValueList) {
|
||||
@ -26,9 +25,9 @@ public class DayOfMonthValueMatcher extends BoolArrayValueMatcher {
|
||||
|
||||
/**
|
||||
* 给定的日期是否匹配当前匹配器
|
||||
*
|
||||
* @param value 被检查的值,此处为日
|
||||
* @param month 实际的月份
|
||||
*
|
||||
* @param value 被检查的值,此处为日
|
||||
* @param month 实际的月份,从1开始
|
||||
* @param isLeapYear 是否闰年
|
||||
* @return 是否匹配
|
||||
*/
|
||||
@ -44,13 +43,13 @@ public class DayOfMonthValueMatcher extends BoolArrayValueMatcher {
|
||||
* 1、闰年2月匹配是否为29
|
||||
* 2、其它月份是否匹配最后一天的日期(可能为30或者31)
|
||||
* </pre>
|
||||
*
|
||||
* @param value 被检查的值
|
||||
* @param month 月份
|
||||
*
|
||||
* @param value 被检查的值
|
||||
* @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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user