mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-07-27 12:42:28 +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 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>
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user