yanlu

fix:直播预告时间问题

import { ContentDTO, LiveRoomDataBean } from 'wdBean';
import { ProcessUtils } from 'wdRouter';
import { CommonConstants } from 'wdConstant/Index';
import PageViewModel from '../../viewmodel/PageViewModel';
import { DateTimeUtils, LazyDataSource, Logger } from 'wdKit/Index';
import { router } from '@kit.ArkUI';
... ...
... ... @@ -504,15 +504,12 @@ struct ReserveMorePage {
const eventMinutes = eventDateTime.getMinutes();
const eventTimeStr = `${eventHour}:${eventMinutes.toString().padStart(2, '0')}开始`; // 格式化时间,确保分钟是两位数
// 计算时间差
const timeDifference = eventDateTime.getTime() - currentDateTime.getTime();
// 如果事件在24小时内
if (type === 1) {
if (timeDifference > 0 && timeDifference <= 24 * 60 * 60 * 1000) {
// 如果是今天
if (eventDateTime.setHours(0,0,0,0) === currentDateTime.setHours(0,0,0,0)) {
return `今天`;
} else {
// 如果事件不在24小时内
// 如果事件不在今天
const month = eventDateTime.getMonth() + 1; // 月份从0开始
const date = eventDateTime.getDate();
return `${month}月${date}日`;
... ...