Commit 4cf410d9 authored by raca's avatar raca

feat: 日期显示优化

parent 4b4f12e0
......@@ -35,6 +35,7 @@ export async function fetchUserDetails (data: { initiator?: string; stageId?: st
export type PkRecord = {
createTime: string,
createTimeStamp: string,
id: number,
initiator: number,
initiatorLevel: string,
......
......@@ -172,7 +172,7 @@ const GameResult = ({
className={gameResultStyles.levelResult}
/>
<Text className={gameResultStyles.levelDate}>
{convertDateTime(record.createTime)}
{convertDateTime(record.createTimeStamp)}
</Text>
</View>
......
......@@ -30,7 +30,7 @@ const GameResult = ({ record }: GameResultProps) => {
className={styles.levelResult}
/>
<Text className={styles.levelDate}>
{convertDateTime(record.createTime)}
{convertDateTime(record.createTimeStamp)}
</Text>
</View>
......
......@@ -9,10 +9,7 @@ function formatMonthDay (date: Date): string {
function formatTime (date: Date): string {
const hours = date.getHours()
const minutes = date.getMinutes()
const seconds = date.getSeconds()
return `${hours.toString().padStart(2, '0')}:${minutes
.toString()
.padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`
return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`
}
export function convertDateTime (value: string): string {
......
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