fix Time column in History of Action tab
This commit is contained in:
parent
ac54fc6e2e
commit
57b5eb7e95
|
@ -25,10 +25,15 @@ import Button from '@mui/material/Button';
|
||||||
import { DateTimePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
import { DateTimePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
||||||
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import utc from 'dayjs/plugin/utc';
|
||||||
|
import timezone from 'dayjs/plugin/timezone';
|
||||||
import EditIcon from '@mui/icons-material/Edit';
|
import EditIcon from '@mui/icons-material/Edit';
|
||||||
import DeleteIcon from '@mui/icons-material/Delete';
|
import DeleteIcon from '@mui/icons-material/Delete';
|
||||||
import { UserContext } from '../../../contexts/userContext';
|
import { UserContext } from '../../../contexts/userContext';
|
||||||
|
|
||||||
|
dayjs.extend(utc);
|
||||||
|
dayjs.extend(timezone);
|
||||||
|
|
||||||
interface HistoryProps {
|
interface HistoryProps {
|
||||||
errorLoadingS3Data: boolean;
|
errorLoadingS3Data: boolean;
|
||||||
id: number;
|
id: number;
|
||||||
|
@ -411,14 +416,18 @@ function HistoryOfActions(props: HistoryProps) {
|
||||||
<Divider />
|
<Divider />
|
||||||
<div style={{ maxHeight: '600px', overflowY: 'auto' }}>
|
<div style={{ maxHeight: '600px', overflowY: 'auto' }}>
|
||||||
{history.map((action, index) => {
|
{history.map((action, index) => {
|
||||||
// Parse the timestamp string to a Date object
|
// // Parse the timestamp string to a Date object
|
||||||
const date = new Date(action.timestamp);
|
// const date = new Date(action.timestamp);
|
||||||
|
//
|
||||||
|
// // Extract the date part (e.g., "2023-05-31")
|
||||||
|
// const datePart = date.toLocaleDateString();
|
||||||
|
//
|
||||||
|
// // Extract the time part (e.g., "12:34:56")
|
||||||
|
// const timePart = date.toLocaleTimeString();
|
||||||
|
const dateCET = dayjs.utc(action.timestamp).tz("Europe/Paris");
|
||||||
|
const datePart = dateCET.format("YYYY-MM-DD");
|
||||||
|
const timePart = dateCET.format("HH:mm:ss");
|
||||||
|
|
||||||
// Extract the date part (e.g., "2023-05-31")
|
|
||||||
const datePart = date.toLocaleDateString();
|
|
||||||
|
|
||||||
// Extract the time part (e.g., "12:34:56")
|
|
||||||
const timePart = date.toLocaleTimeString();
|
|
||||||
const iconStyle =
|
const iconStyle =
|
||||||
action.userName === currentUser.name
|
action.userName === currentUser.name
|
||||||
? {}
|
? {}
|
||||||
|
|
Loading…
Reference in New Issue