Merge pull request #3961 from Kieran-Gould/kieran-gould/12hourtimestamp

Kieran gould/12hourtimestamp
This commit is contained in:
Matthew Hodgson 2017-05-26 18:23:11 +01:00 committed by GitHub
commit 9156a871f5
3 changed files with 17 additions and 6 deletions

View file

@ -16,19 +16,23 @@ limitations under the License.
'use strict'; 'use strict';
var React = require('react'); import * as UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore';
var DateUtils = require('matrix-react-sdk/lib/DateUtils'); const React = require('react');
const DateUtils = require('matrix-react-sdk/lib/DateUtils');
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MessageTimestamp', displayName: 'MessageTimestamp',
propTypes: {
showTwelveHour: React.PropTypes.bool,
},
render: function() { render: function() {
var date = new Date(this.props.ts); const date = new Date(this.props.ts);
return ( return (
<span className="mx_MessageTimestamp" title={ DateUtils.formatFullDate(date) }> <span className="mx_MessageTimestamp" title={ DateUtils.formatFullDate(date) }>
{ DateUtils.formatTime(date) } { DateUtils.formatTime(date, this.props.showTwelveHour) }
</span> </span>
); );
}, },
}); });

View file

@ -112,4 +112,3 @@ limitations under the License.
.mx_FilePanel .mx_EventTile_selected .mx_EventTile_line { .mx_FilePanel .mx_EventTile_selected .mx_EventTile_line {
padding-left: 0px; padding-left: 0px;
} }

View file

@ -263,6 +263,14 @@ limitations under the License.
cursor: pointer; cursor: pointer;
} }
.mx_EventTile_12hr .mx_EventTile_e2eIcon {
padding-left: 5px;
}
.mx_EventTile_12hr .mx_MessageTimestamp {
text-align: center;
}
.mx_EventTile:hover.mx_EventTile_verified .mx_EventTile_line, .mx_EventTile:hover.mx_EventTile_verified .mx_EventTile_line,
.mx_EventTile:hover.mx_EventTile_unverified .mx_EventTile_line { .mx_EventTile:hover.mx_EventTile_unverified .mx_EventTile_line {
padding-left: 60px; padding-left: 60px;