|
|
@@ -1,6 +1,7 @@
|
|
|
import { useState } from 'react'
|
|
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
|
|
import { Plus, Search, Edit, Trash2, Eye } from 'lucide-react'
|
|
|
+import { format } from 'date-fns'
|
|
|
import { useForm } from 'react-hook-form'
|
|
|
import { zodResolver } from '@hookform/resolvers/zod'
|
|
|
import { toast } from 'sonner'
|
|
|
@@ -194,10 +195,10 @@ export const AdvertisementTypesPage = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 格式化时间戳
|
|
|
- const formatTimestamp = (timestamp: number | null) => {
|
|
|
- if (!timestamp) return '-'
|
|
|
- return new Date(timestamp * 1000).toLocaleString('zh-CN')
|
|
|
+ // 格式化时间
|
|
|
+ const formatDate = (date: string | null) => {
|
|
|
+ if (!date) return '-'
|
|
|
+ return format(new Date(date), 'yyyy-MM-dd HH:mm')
|
|
|
}
|
|
|
|
|
|
if (isLoading) {
|
|
|
@@ -289,7 +290,7 @@ export const AdvertisementTypesPage = () => {
|
|
|
</Badge>
|
|
|
</TableCell>
|
|
|
<TableCell className="text-sm">
|
|
|
- {formatTimestamp(type.createTime)}
|
|
|
+ {formatDate(type.createdAt)}
|
|
|
</TableCell>
|
|
|
<TableCell className="text-right">
|
|
|
<div className="flex justify-end gap-2">
|