mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 06:37:56 +01:00
Fix time render bug.
This commit is contained in:
parent
46823ccc3e
commit
b892c25e3c
@ -66,7 +66,7 @@
|
|||||||
"@wisemapping/editor": "^0.4.0",
|
"@wisemapping/editor": "^0.4.0",
|
||||||
"@wisemapping/mindplot": "^5.0.2",
|
"@wisemapping/mindplot": "^5.0.2",
|
||||||
"axios": "^0.21.0",
|
"axios": "^0.21.0",
|
||||||
"dayjs": "^1.10.4",
|
"dayjs": "^1.10.7",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.0",
|
"react-dom": "^17.0.0",
|
||||||
"react-ga": "^3.3.0",
|
"react-ga": "^3.3.0",
|
||||||
|
@ -96,7 +96,7 @@ class MockClient implements Client {
|
|||||||
12,
|
12,
|
||||||
false,
|
false,
|
||||||
'El Mapa3',
|
'El Mapa3',
|
||||||
[label2, label3],
|
[label2, label3],
|
||||||
'Paulo3',
|
'Paulo3',
|
||||||
'2008-06-02T00:00:00Z',
|
'2008-06-02T00:00:00Z',
|
||||||
'Berna',
|
'Berna',
|
||||||
@ -109,6 +109,7 @@ class MockClient implements Client {
|
|||||||
|
|
||||||
this.labels = [label1, label2, label3];
|
this.labels = [label1, label2, label3];
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchMindmap(id: number): Mindmap {
|
fetchMindmap(id: number): Mindmap {
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const xmlDoc = parser.parseFromString(`
|
const xmlDoc = parser.parseFromString(`
|
||||||
@ -254,6 +255,7 @@ class MockClient implements Client {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchHistory(id: number): Promise<ChangeHistory[]> {
|
fetchHistory(id: number): Promise<ChangeHistory[]> {
|
||||||
console.log(`Fetching history for ${id}`);
|
console.log(`Fetching history for ${id}`);
|
||||||
const result = [
|
const result = [
|
||||||
|
@ -12,6 +12,12 @@ import Card from '@mui/material/Card';
|
|||||||
import ListItem from '@mui/material/ListItem';
|
import ListItem from '@mui/material/ListItem';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import List from '@mui/material/List';
|
import List from '@mui/material/List';
|
||||||
|
import LocalizedFormat from 'dayjs/plugin/localizedFormat';
|
||||||
|
|
||||||
|
|
||||||
|
// Load fromNow pluggin
|
||||||
|
dayjs.extend(LocalizedFormat)
|
||||||
|
|
||||||
|
|
||||||
const InfoDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement => {
|
const InfoDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement => {
|
||||||
const { map } = fetchMapById(mapId);
|
const { map } = fetchMapById(mapId);
|
||||||
@ -99,7 +105,7 @@ const InfoDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement =
|
|||||||
:
|
:
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2">
|
<Typography variant="body2">
|
||||||
{dayjs(map?.creationTime).format('lll')}
|
{dayjs(map?.creationTime).format('LLL')}
|
||||||
</Typography>
|
</Typography>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
@ -131,7 +137,7 @@ const InfoDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement =
|
|||||||
:
|
:
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2">
|
<Typography variant="body2">
|
||||||
{dayjs(map?.lastModificationTime).format('lll')}
|
{dayjs(map?.lastModificationTime).format('LLL')}
|
||||||
</Typography>
|
</Typography>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
|
@ -36,8 +36,9 @@ import SearchIcon from '@mui/icons-material/Search';
|
|||||||
import { AddLabelButton } from './add-label-button';
|
import { AddLabelButton } from './add-label-button';
|
||||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
import { LabelsCell } from './labels-cell';
|
import { LabelsCell } from './labels-cell';
|
||||||
|
import LocalizedFormat from 'dayjs/plugin/localizedFormat';
|
||||||
|
|
||||||
// Load fromNow pluggin
|
dayjs.extend(LocalizedFormat)
|
||||||
dayjs.extend(relativeTime);
|
dayjs.extend(relativeTime);
|
||||||
|
|
||||||
function descendingComparator<T>(a: T, b: T, orderBy: keyof T) {
|
function descendingComparator<T>(a: T, b: T, orderBy: keyof T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user