[catalog][xs]: made created/updated fields more human-readable.

This commit is contained in:
anuveyatsu 2021-08-14 20:33:57 +06:00
parent f9b9cf3680
commit 0d11409088
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,7 @@
/* eslint-disable react/display-name */
import Link from 'next/link';
import { useQuery } from '@apollo/react-hooks';
import * as timeago from 'timeago.js';
import { Table, ErrorMessage } from '../_shared';
import { GET_RESOURCES_QUERY } from '../../graphql/queries';
@ -22,10 +23,12 @@ const columns = [
{
name: 'Created',
key: 'created',
render: ({ created }) => timeago.format(created),
},
{
name: 'Updated',
key: 'last_modified',
key: 'updated',
render: ({ updated }) => timeago.format(updated),
},
{
name: 'Link',

View File

@ -41,7 +41,7 @@ export const GET_RESOURCES_QUERY = gql`
title
format
created
last_modified
updated: last_modified
}
}
}