mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -108,11 +108,7 @@ public enum Month {
|
||||
* @return 此月份最后一天的值
|
||||
*/
|
||||
public int getLastDay(boolean isLeapYear) {
|
||||
int lastDay = DAYS_OF_MONTH[value];
|
||||
if (isLeapYear && Calendar.FEBRUARY == value){
|
||||
lastDay += 1;
|
||||
}
|
||||
return lastDay;
|
||||
return getLastDay(this.value, isLeapYear);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,4 +162,20 @@ public enum Month {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得指定月的最后一天
|
||||
* @param month 月份
|
||||
* @param isLeapYear 是否为闰年,闰年只对二月有影响
|
||||
* @return 最后一天,可能为28,29,30,31
|
||||
* @since 5.4.7
|
||||
*/
|
||||
public static int getLastDay(int month, boolean isLeapYear){
|
||||
int lastDay = DAYS_OF_MONTH[month];
|
||||
if (isLeapYear && Calendar.FEBRUARY == month){
|
||||
// 二月
|
||||
lastDay += 1;
|
||||
}
|
||||
return lastDay;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user