[catalog][xs]: made created/updated fields more human-readable.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
/* eslint-disable react/display-name */
|
/* eslint-disable react/display-name */
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { useQuery } from '@apollo/react-hooks';
|
import { useQuery } from '@apollo/react-hooks';
|
||||||
|
import * as timeago from 'timeago.js';
|
||||||
import { Table, ErrorMessage } from '../_shared';
|
import { Table, ErrorMessage } from '../_shared';
|
||||||
import { GET_RESOURCES_QUERY } from '../../graphql/queries';
|
import { GET_RESOURCES_QUERY } from '../../graphql/queries';
|
||||||
|
|
||||||
@@ -22,10 +23,12 @@ const columns = [
|
|||||||
{
|
{
|
||||||
name: 'Created',
|
name: 'Created',
|
||||||
key: 'created',
|
key: 'created',
|
||||||
|
render: ({ created }) => timeago.format(created),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Updated',
|
name: 'Updated',
|
||||||
key: 'last_modified',
|
key: 'updated',
|
||||||
|
render: ({ updated }) => timeago.format(updated),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Link',
|
name: 'Link',
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export const GET_RESOURCES_QUERY = gql`
|
|||||||
title
|
title
|
||||||
format
|
format
|
||||||
created
|
created
|
||||||
last_modified
|
updated: last_modified
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user