mirror of
https://github.com/PlayEdu/backend
synced 2025-07-23 22:29:39 +08:00
管理日志时区筛选
This commit is contained in:
parent
5ca6c18513
commit
8e5c072634
@ -3,7 +3,7 @@ import { Table, Typography, Input, Button, DatePicker } from "antd";
|
||||
import { adminLog } from "../../../api";
|
||||
// import styles from "./index.module.less";
|
||||
import type { ColumnsType } from "antd/es/table";
|
||||
import { dateWholeFormat } from "../../../utils/index";
|
||||
import { dateWholeFormat, transUtcTime } from "../../../utils/index";
|
||||
import { AdminLogDetailDialog } from "./compenents/detail-dialog";
|
||||
const { RangePicker } = DatePicker;
|
||||
import moment from "moment";
|
||||
@ -176,8 +176,10 @@ const SystemLogPage = () => {
|
||||
value={createdAts}
|
||||
style={{ marginLeft: 10 }}
|
||||
onChange={(date, dateString) => {
|
||||
dateString[0] += "T00:00:00.000+00:00";
|
||||
dateString[1] += "T23:59:59.000+00:00";
|
||||
let date1 = dateString[0] + " 00:00:00";
|
||||
let date2 = dateString[1] + " 23:59:59";
|
||||
dateString[0] = transUtcTime(date1);
|
||||
dateString[1] = transUtcTime(date2);
|
||||
setCreatedAt(dateString);
|
||||
setCreatedAts(date);
|
||||
}}
|
||||
|
@ -140,3 +140,13 @@ export function dateWholeFormat(dateStr: string) {
|
||||
}
|
||||
return moment(dateStr).format("YYYY-MM-DD HH:mm:ss");
|
||||
}
|
||||
|
||||
export function transUtcTime(value: string) {
|
||||
const specifiedTime = value;
|
||||
// 创建一个新的Date对象,传入指定时间
|
||||
const specifiedDate = new Date(specifiedTime);
|
||||
//将指定时间转换为UTC+0时间
|
||||
const utcTime = specifiedDate.toISOString();
|
||||
|
||||
return utcTime;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user