Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yanlu
2024-05-18 11:38:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
47c56eb12c565f392371e895a986a954e760e566
47c56eb1
1 parent
0a500fc3
fix:直播预告时间问题
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/LiveMorePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/reserveMore/ReserveMorePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/LiveMorePage.ets
View file @
47c56eb
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';
...
...
sight_harmony/features/wdComponent/src/main/ets/components/reserveMore/ReserveMorePage.ets
View file @
47c56eb
...
...
@@ -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}日`;
...
...
Please
register
or
login
to post a comment