1 import { Component } from 'inferno';
2 import * as moment from 'moment';
3 import 'moment/locale/de.js';
4 import { getLanguage } from '../utils';
5 import { i18n } from '../i18next';
7 interface MomentTimeProps {
15 export class MomentTime extends Component<MomentTimeProps, any> {
17 constructor(props: any, context: any) {
18 super(props, context);
19 // console.log(moment.locales());
20 moment.locale(getLanguage());
24 if (this.props.data.updated) {
26 <span title={this.props.data.updated} className="font-italics">{i18n.t('modified')} {moment.utc(this.props.data.updated).fromNow()}</span>
29 let str = this.props.data.published || this.props.data.when_;
31 <span title={str}>{moment.utc(str).fromNow()}</span>