mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add method
This commit is contained in:
parent
1e636f0016
commit
9fb11f6525
@ -943,6 +943,24 @@ public class DateTime extends Date {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为本月最后一天
|
||||
* @return 是否为本月最后一天
|
||||
* @since 5.8.8
|
||||
*/
|
||||
public boolean isLastDayOfMonth(){
|
||||
return dayOfMonth() == getLastDayOfMonth();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得本月的最后一天
|
||||
* @return 天
|
||||
* @since 5.8.8
|
||||
*/
|
||||
public int getLastDayOfMonth(){
|
||||
return monthEnum().getLastDay(isLeapYear());
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------- toString start
|
||||
|
||||
/**
|
||||
|
@ -2004,6 +2004,26 @@ public class DateUtil extends CalendarUtil {
|
||||
return startTime.before(realEndTime) && endTime.after(realStartTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为本月最后一天
|
||||
* @param date {@link Date}
|
||||
* @return 是否为本月最后一天
|
||||
* @since 5.8.8
|
||||
*/
|
||||
public static boolean isLastDayOfMonth(final Date date){
|
||||
return date(date).isLastDayOfMonth();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得本月的最后一天
|
||||
* @param date {@link Date}
|
||||
* @return 天
|
||||
* @since 5.8.8
|
||||
*/
|
||||
public static int getLastDayOfMonth(final Date date){
|
||||
return date(date).getLastDayOfMonth();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------ Private method start
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user