From 280c772c753d57fd35ce903efb01c66ccab54f09 Mon Sep 17 00:00:00 2001 From: Mavis Ou Date: Tue, 26 May 2015 17:28:45 -0700 Subject: [PATCH] Added moment.js & updated Twitter link --- package.json | 1 + pages/home.jsx | 21 +++++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 58a9a92c2..ea6a9c109 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "mocha": "^2.1.0", "mocha-phantomjs": "^3.5.3", "mofo-style": "^1.0.1", + "moment": "^2.10.3", "phantomjs": "^1.9.16", "react": "^0.13.1", "react-ga": "^1.0.12", diff --git a/pages/home.jsx b/pages/home.jsx index 5938f7fd9..e48c51887 100644 --- a/pages/home.jsx +++ b/pages/home.jsx @@ -1,6 +1,7 @@ var React = require('react'); var Router = require('react-router'); var Link = Router.Link; +var moment = require('moment'); var HeroUnit = require('../components/hero-unit.jsx'); var Blockquote = require('../components/blockquote.jsx'); @@ -8,6 +9,8 @@ var Illustration = require('../components/illustration.jsx'); var IconLinks = require('../components/icon-links.jsx'); var IconLink = require('../components/icon-link.jsx'); +var config = require('../lib/config'); + var CaseStudies = React.createClass({ render: function() { return ( @@ -30,16 +33,15 @@ var FeaturedPost = React.createClass({ data: React.PropTypes.object.isRequired }, render: function() { - var publishedDate = new Date(this.props.data.publishedDate); - var month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][publishedDate.getMonth()]; + var parsedDate = moment(this.props.data.publishedDate); return(

@@ -61,11 +63,6 @@ var LatestPosts = React.createClass({ data: React.PropTypes.array.isRequired }, render: function() { - function formatDate(theDate) { - return ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][theDate.getMonth()] + " " + - theDate.getDate() + ", " + - theDate.getFullYear(); - } return (