修复 时间 格式化为题
This commit is contained in:
@@ -185,6 +185,7 @@ const QueryTransactions = () => {
|
||||
const format_time = (time: string) => {
|
||||
time = time.replace(/-/g, "/");
|
||||
const date = new Date(time);
|
||||
const year = String(date.getFullYear());
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
const hours = String(date.getHours()).padStart(2, "0");
|
||||
@@ -192,7 +193,7 @@ const QueryTransactions = () => {
|
||||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
||||
|
||||
return {
|
||||
date: `2025-${month}-${day}`,
|
||||
date: `${year}-${month}-${day}`,
|
||||
time: `${hours}:${minutes}:${seconds}`,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -377,6 +377,7 @@ const WalletPage: React.FC = () => {
|
||||
const format_time = (time: string) => {
|
||||
time = time.replace(/-/g, "/");
|
||||
const date = new Date(time);
|
||||
const year = String(date.getFullYear());
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
const hours = String(date.getHours()).padStart(2, "0");
|
||||
@@ -384,7 +385,7 @@ const WalletPage: React.FC = () => {
|
||||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
||||
|
||||
return {
|
||||
date: `2025-${month}-${day}`,
|
||||
date: `${year}-${month}-${day}`,
|
||||
time: `${hours}:${minutes}:${seconds}`,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user