1 import { Component } from 'inferno';
2 import * as moment from 'moment';
3 import 'moment/locale/de';
4 import 'moment/locale/zh-cn';
5 import 'moment/locale/fr';
6 import 'moment/locale/sv';
7 import 'moment/locale/ru';
8 import { getMomentLanguage } from '../utils';
9 import { i18n } from '../i18next';
11 interface MomentTimeProps {
19 export class MomentTime extends Component<MomentTimeProps, any> {
21 constructor(props: any, context: any) {
22 super(props, context);
24 let lang = getMomentLanguage();
30 if (this.props.data.updated) {
32 <span title={this.props.data.updated} className="font-italics">{i18n.t('modified')} {moment.utc(this.props.data.updated).fromNow()}</span>
35 let str = this.props.data.published || this.props.data.when_;
37 <span title={str}>{moment.utc(str).fromNow()}</span>