Commit 4cf410d9 authored by raca's avatar raca

feat: 日期显示优化

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