Add 12 hour support

This commit is contained in:
Maxwell Kepler 2017-05-18 22:01:00 +01:00 committed by Kieran Gould
parent dc990f47be
commit 9e37fa46b1
3 changed files with 22 additions and 10 deletions

View file

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

View file

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

View file

@ -94,7 +94,7 @@ limitations under the License.
*/
.mx_EventTile_selected .mx_EventTile_line {
border-left: $accent-color 5px solid;
padding-left: 60px;
padding-left: 100px;
background-color: $event-selected-color;
}
@ -263,6 +263,10 @@ limitations under the License.
cursor: pointer;
}
.mx_EventTile_e2eIcon_12hr {
padding-left: 5px;
}
.mx_EventTile:hover.mx_EventTile_verified .mx_EventTile_line,
.mx_EventTile:hover.mx_EventTile_unverified .mx_EventTile_line {
padding-left: 60px;