mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-08-06 01:18:14 +02:00
Remove the use of Moment.js.
This is a heavy library that is hardly used, in addition, it is already quite deprecated, see here: https://momentjs.com/docs/#/-project-status/
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
// @flow strict
|
||||
import React from 'react';
|
||||
import moment from 'moment';
|
||||
import { Link } from 'gatsby';
|
||||
import type { Edges } from '../../types';
|
||||
import styles from './Feed.module.scss';
|
||||
@@ -14,8 +13,8 @@ const Feed = ({ edges }: Props) => (
|
||||
{edges.map((edge) => (
|
||||
<div className={styles['feed__item']} key={edge.node.fields.slug}>
|
||||
<div className={styles['feed__item-meta']}>
|
||||
<time className={styles['feed__item-meta-time']} dateTime={moment(edge.node.frontmatter.date).format('MMMM D, YYYY')}>
|
||||
{moment(edge.node.frontmatter.date).format('MMMM YYYY')}
|
||||
<time className={styles['feed__item-meta-time']} dateTime={ new Date(edge.node.frontmatter.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })}>
|
||||
{ new Date(edge.node.frontmatter.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long' })}
|
||||
</time>
|
||||
<span className={styles['feed__item-meta-divider']} />
|
||||
<span className={styles['feed__item-meta-category']}>
|
||||
|
Reference in New Issue
Block a user