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> {
16 constructor(props: any, context: any) {
17 super(props, context);
19 let lang = getMomentLanguage();
25 if (this.props.data.updated) {
27 <span title={this.props.data.updated} className="font-italics">{i18n.t('modified')} {moment.utc(this.props.data.updated).fromNow()}</span>
30 let str = this.props.data.published || this.props.data.when_;
32 <span title={str}>{moment.utc(str).fromNow()}</span>