Use timeago.

This commit is contained in:
gaba
2017-05-15 16:04:10 -07:00
parent c0c6dd6252
commit 61856c3cf6
+2 -1
View File
@@ -1,11 +1,12 @@
import React from 'react';
import timeago from 'timeago.js';
import {I18n} from '../coral-framework';
const lang = new I18n();
const name = 'coral-plugin-pubdate';
const PubDate = ({created_at}) => <div className={`${name}-text`}>
{lang.timeago(created_at)}
{timeago().format(created_at, lang.getLocale().replace('-', '_'))}
</div>;
export default PubDate;