修复收藏等问题
This commit is contained in:
@@ -45,9 +45,12 @@ public class MusicUtil {
|
||||
*/
|
||||
public static boolean isCurrentTimeInRange(Date startDate, Date endDate) {
|
||||
Date now = new Date(); // 获取当前时间
|
||||
if (startDate == null || endDate == null){
|
||||
return false;
|
||||
}
|
||||
|
||||
// 处理跨越日期的情况(结束时间早于开始时间)
|
||||
if (endDate.before(startDate)) {
|
||||
if (startDate != null && endDate.before(startDate)) {
|
||||
// 当前时间 >= 开始时间 或 当前时间 <= 结束时间
|
||||
return now.after(startDate) || now.before(endDate) || now.equals(startDate) || now.equals(endDate);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user