修改 列表 时间格式化问题
This commit is contained in:
@@ -2,12 +2,14 @@ import { View, Text, Image } from "@tarojs/components";
|
||||
import Taro from "@tarojs/taro";
|
||||
import img from "../../config/images";
|
||||
import { ListCardProps } from "../../../types/list/types";
|
||||
import { formatGameTime, calculateDuration } from "@/utils/timeUtils";
|
||||
import "./index.scss";
|
||||
|
||||
const ListCard: React.FC<ListCardProps> = ({
|
||||
id,
|
||||
title,
|
||||
start_time,
|
||||
end_time,
|
||||
location,
|
||||
distance_km,
|
||||
current_players,
|
||||
@@ -112,7 +114,11 @@ const ListCard: React.FC<ListCardProps> = ({
|
||||
|
||||
{/* 时间信息 */}
|
||||
<View className="date-time">
|
||||
<Text>{start_time}</Text>
|
||||
<Text>{formatGameTime(start_time)}</Text>
|
||||
{/* 时长 如 2小时 */}
|
||||
{end_time && (
|
||||
<Text> {calculateDuration(start_time, end_time)}</Text>
|
||||
)}
|
||||
</View>
|
||||
|
||||
{/* 地点,室内外,距离 */}
|
||||
|
||||
Reference in New Issue
Block a user