various cosmetic fixes based on design feedback

This commit is contained in:
Matthew Hodgson 2015-10-11 17:28:36 +01:00
parent 9a8a9a4ce4
commit ba0ae5ba59
5 changed files with 21 additions and 5 deletions

View file

@ -24,11 +24,20 @@ module.exports = React.createClass({
displayName: 'MessageTimestamp',
mixins: [MessageTimestampController],
formatDate: function(date) {
// date.toLocaleTimeString is completely system dependent.
// just go 24h for now
function pad(n) {
return (n < 10 ? '0' : '') + n;
}
return pad(date.getHours()) + ':' + pad(date.getMinutes());
},
render: function() {
var date = new Date(this.props.ts);
return (
<span className="mx_MessageTimestamp">
{date.toLocaleTimeString()}
{ this.formatDate(date) }
</span>
);
},