feat: 项目需求管理
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package org.nl.common.pojo;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 下拉框字段
|
||||
* @Author: lyd
|
||||
* @Date: 2025/11/11
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class SelectListItem {
|
||||
public String label;
|
||||
|
||||
public String value;
|
||||
}
|
||||
@@ -17,6 +17,9 @@ import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -180,4 +183,17 @@ public class CommonTimeFormatUtil {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static long calculateDaysBetween(Date startTime, Date endTime) {
|
||||
// 将 Date 转换为 LocalDate
|
||||
LocalDate startDate = startTime.toInstant()
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toLocalDate();
|
||||
LocalDate endDate = endTime.toInstant()
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toLocalDate();
|
||||
|
||||
// 计算天数差
|
||||
return ChronoUnit.DAYS.between(startDate, endDate);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user