fix: ensure date is Date (#11)

This commit is contained in:
Marc Cataford 2021-07-17 13:04:01 -04:00 committed by GitHub
parent cfd40d4db9
commit 38e944437a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,7 +27,7 @@ function ItemCard(props: CardProps): ReactNode {
const { title, url, published } = props
const classes = useStyles()
const formattedDate = published.toLocaleString('en-GB', { timeZone: 'UTC' })
const formattedDate = (new Date(published)).toLocaleString('en-GB', { timeZone: 'UTC' })
return (
<Card className={classes.root}>
<a href={url}>{title}</a>