1 import { Component } from 'inferno';
2 import * as moment from 'moment';
3 import { getMomentLanguage } from '../utils';
4 import { i18n } from '../i18next';
6 interface MomentTimeProps {
14 export class MomentTime extends Component<MomentTimeProps, any> {
15 constructor(props: any, context: any) {
16 super(props, context);
18 let lang = getMomentLanguage();
24 if (this.props.data.updated) {
26 <span title={this.props.data.updated} className="font-italics">
27 {i18n.t('modified')} {moment.utc(this.props.data.updated).fromNow()}
31 let str = this.props.data.published || this.props.data.when_;
32 return <span title={str}>{moment.utc(str).fromNow()}</span>;