Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Transition from moment to luxon
  • Loading branch information
karenying committed Nov 29, 2020
1 parent d985f1e commit b8a1264
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -75,6 +75,7 @@
"invariant": "^2.2.4",
"katex": "^0.12.0",
"lodash": "^4.17.20",
"luxon": "^1.25.0",
"netlify-cms-app": "^2.12.27",
"node-sass": "^4.14.1",
"normalize-scss": "^7.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Feed/Feed.js
@@ -1,7 +1,7 @@
import React from 'react';
import { Link } from 'gatsby';
import styles from './Feed.module.scss';
import moment from 'moment';
import { DateTime } from 'luxon';

export const Tags = ({ tags, tagSlugs }) => (
<div className={styles['feed__item-tags-container']}>
Expand Down Expand Up @@ -38,7 +38,7 @@ const Feed = ({ edges }) => (
<div className={styles['feed__item-details']}>
<p>
<span className='dark-pink-text'>
{moment(new Date(edge.node.frontmatter.date)).format('MMM D')}
{DateTime.fromISO(edge.node.frontmatter.date).toFormat('MMM d')}
</span>
<span className={`${styles['feed__item-details-dot']} yellow-text`}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Post/Content/Content.js
@@ -1,7 +1,7 @@
import React from 'react';
import styles from './Content.module.scss';
import feedStyles from '../../Feed/Feed.module.scss';
import moment from 'moment';
import { DateTime } from 'luxon';

const Content = ({ body, title, description, date, minutes }) => (
<div className={styles['content']}>
Expand All @@ -12,7 +12,7 @@ const Content = ({ body, title, description, date, minutes }) => (
>
<p>
<span className='dark-pink-text'>
{moment(new Date(date)).format('MMM D, YYYY')}
{DateTime.fromISO(date).toFormat('MMM d, yyyy')}
</span>
<span className={`${feedStyles['feed__item-details-dot']} yellow-text`}>
Expand Down

0 comments on commit b8a1264

Please sign in to comment.