From aa43f8beab132f77afaa702d9736fb4525e9b851 Mon Sep 17 00:00:00 2001 From: thinkholic Date: Thu, 6 Oct 2016 15:49:33 +0530 Subject: [PATCH 1/2] install moment NPM --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index eb18f1fcd00c..846df6e90123 100644 --- a/package.json +++ b/package.json @@ -39,5 +39,8 @@ "@kadira/storybook-addons": "^1.5.0", "react": "^0.14.7 || ^15.0.0", "react-dom": "^0.14.7 || ^15.0.0" + }, + "dependencies": { + "moment": "^2.15.1" } } From 2ad06cb5254ed0841cda406c05c4e19aa8467f3f Mon Sep 17 00:00:00 2001 From: thinkholic Date: Thu, 6 Oct 2016 15:50:09 +0530 Subject: [PATCH 2/2] change date format on comment section --- src/manager/components/CommentList/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/manager/components/CommentList/index.js b/src/manager/components/CommentList/index.js index faa6fe90a3e7..d80fc1ffbda8 100644 --- a/src/manager/components/CommentList/index.js +++ b/src/manager/components/CommentList/index.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import moment from 'moment'; import style from './style'; export default class CommentList extends Component { @@ -29,7 +30,7 @@ export default class CommentList extends Component { } formatTime(ts) { - return new Date(ts).toLocaleString(); + return moment(new Date(ts), "YYYYMMDD").fromNow(); } renderComment(comment, key) {