1 import { Component } from 'inferno';
2 import * as moment from 'moment';
4 interface MomentTimeProps {
12 export class MomentTime extends Component<MomentTimeProps, any> {
14 constructor(props: any, context: any) {
15 super(props, context);
19 if (this.props.data.updated) {
21 <span title={this.props.data.updated} className="font-italics">modified {moment.utc(this.props.data.updated).fromNow()}</span>
24 let str = this.props.data.published || this.props.data.when_;
26 <span title={str}>{moment.utc(str).fromNow()}</span>