From 204bd015467cf218b8367fae49455610ff2ca1d5 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Nov 22 2017 11:12:03 +0000 Subject: Don't display the seconds in the contact widget --- diff --git a/hubs/static/client/app/widgets/contact/CurrentTime.js b/hubs/static/client/app/widgets/contact/CurrentTime.js index 6c80d33..73d9eea 100644 --- a/hubs/static/client/app/widgets/contact/CurrentTime.js +++ b/hubs/static/client/app/widgets/contact/CurrentTime.js @@ -1,5 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { + FormattedTime +} from "react-intl"; export default class CurrentTime extends React.Component { @@ -32,14 +35,15 @@ export default class CurrentTime extends React.Component { // create new Date object using supplied offset const nd = new Date(utc + (1000 * this.props.offset)); // set time as a string - this.setState({time: nd.toLocaleTimeString()}); + this.setState({time: nd}); } render() { + if (!this.state.time) { + return null; + } return ( - - {this.state.time} - + ); } }