Updated packages. Changed date picker package to Day.JS and applied it across whole app.
This commit is contained in:
@@ -15,12 +15,15 @@ import {
|
||||
Divider,
|
||||
} from '@mui/material';
|
||||
import { Close, ChevronLeft, ChevronRight } from '@mui/icons-material';
|
||||
import { formatDistanceToNow } from 'date-fns';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import { useAuditLogStream } from '../hooks/useAuditLogStream';
|
||||
import { AdminSkeleton } from './AdminSkeleton';
|
||||
import { EmptyState } from './EmptyState';
|
||||
import { ErrorState } from './ErrorState';
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
/**
|
||||
* Props for AuditLogDrawer component
|
||||
*/
|
||||
@@ -154,9 +157,7 @@ export const AuditLogDrawer: React.FC<AuditLogDrawerProps> = ({
|
||||
component="span"
|
||||
color="text.secondary"
|
||||
>
|
||||
{formatDistanceToNow(new Date(log.createdAt), {
|
||||
addSuffix: true,
|
||||
})}
|
||||
{dayjs(log.createdAt).fromNow()}
|
||||
</Typography>
|
||||
{log.resourceType && (
|
||||
<Typography
|
||||
@@ -193,10 +194,7 @@ export const AuditLogDrawer: React.FC<AuditLogDrawerProps> = ({
|
||||
}}
|
||||
>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Updated{' '}
|
||||
{formatDistanceToNow(lastUpdated, {
|
||||
addSuffix: true,
|
||||
})}
|
||||
Updated {dayjs(lastUpdated).fromNow()}
|
||||
</Typography>
|
||||
<Box>
|
||||
<IconButton
|
||||
|
||||
@@ -21,12 +21,15 @@ import {
|
||||
ChevronLeft,
|
||||
ChevronRight,
|
||||
} from '@mui/icons-material';
|
||||
import { formatDistanceToNow } from 'date-fns';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import { useAuditLogStream } from '../hooks/useAuditLogStream';
|
||||
import { AdminSkeleton } from './AdminSkeleton';
|
||||
import { EmptyState } from './EmptyState';
|
||||
import { ErrorState } from './ErrorState';
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
/**
|
||||
* Props for AuditLogPanel component
|
||||
*/
|
||||
@@ -148,9 +151,7 @@ export const AuditLogPanel: React.FC<AuditLogPanelProps> = ({
|
||||
component="span"
|
||||
color="text.secondary"
|
||||
>
|
||||
{formatDistanceToNow(new Date(log.createdAt), {
|
||||
addSuffix: true,
|
||||
})}
|
||||
{dayjs(log.createdAt).fromNow()}
|
||||
</Typography>
|
||||
{log.resourceType && (
|
||||
<Typography
|
||||
@@ -186,10 +187,7 @@ export const AuditLogPanel: React.FC<AuditLogPanelProps> = ({
|
||||
}}
|
||||
>
|
||||
<Typography variant="caption" color="text.secondary">
|
||||
Updated{' '}
|
||||
{formatDistanceToNow(lastUpdated, {
|
||||
addSuffix: true,
|
||||
})}
|
||||
Updated {dayjs(lastUpdated).fromNow()}
|
||||
</Typography>
|
||||
<Box>
|
||||
<IconButton
|
||||
|
||||
Reference in New Issue
Block a user