receptor/src/ui/date.js

17 lines
357 B
JavaScript
Raw Normal View History

2017-09-10 14:29:43 +02:00
import React, { Component } from 'react';
import formatDate from '../date';
export default class DateDisplay extends Component {
componentDidMount() {
setInterval(() => this.forceUpdate(), this.interval);
}
componentWillUnmount() {
clearInterval(this.interval);
}
render() {
return <span>{formatDate(this.props.when)}</span>;
}
}