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:
Elad Sivan
2020-09-15 14:51:20 +03:00
parent aaab52b87a
commit bdcfa859eb
4 changed files with 3 additions and 407 deletions

View File

@@ -1,6 +1,5 @@
// @flow strict
import React from 'react';
import moment from 'moment';
import styles from './Meta.module.scss';
type Props = {
@@ -9,7 +8,7 @@ type Props = {
const Meta = ({ date }: Props) => (
<div className={styles['meta']}>
<p className={styles['meta__date']}>Published {moment(date).format('D MMM YYYY')}</p>
<p className={styles['meta__date']}>Published {new Date(date).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' })}</p>
</div>
);