记得上下班打卡 | git大法好,push需谨慎

Commit c9bf02ac authored by wangyifan's avatar wangyifan

修改计算最近时间逻辑

parent 299ccf38
......@@ -50,6 +50,9 @@ public class SweetAppletController {
List<SweetManualAppletDto> vo = ObjectUtil.getSweetManualAppletDtoList();
for (SweetManualAppletDto item : dto) {
if (item.getTitle().contains(name)) {
if (item.getIsReleaseManual() == null) {
item.setIsReleaseManual(0);
}
vo.add(item);
}
}
......
......@@ -43,7 +43,8 @@ public class MarkNearestUtils {
// 可选:如果只考虑未来或正在进行的演出,可取消下面的注释
if (startTime.before(now)) continue;
if (nearestTime == null || startTime.before(nearestTime)) {
if (nearestTime == null || Math.abs(startTime.getTime() - now.getTime()) <
Math.abs(nearestTime.getTime() - now.getTime())) {
nearestTime = startTime;
nearest = dto;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment