forked from matrix/element-web
Add 12 hour support
This commit is contained in:
parent
dc990f47be
commit
9e37fa46b1
|
@ -16,19 +16,28 @@ 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',
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
var date = new Date(this.props.ts);
|
var date = new Date(this.props.ts);
|
||||||
|
if (UserSettingsStore.getSyncedSetting('showTwelveHourTimestamps')) {
|
||||||
|
return (
|
||||||
|
<span style={{ textAlign: 'center' }} className="mx_MessageTimestamp" title={ DateUtils.formatFullDate(date) }>
|
||||||
|
{ DateUtils.formatTime(date) }
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
return (
|
return (
|
||||||
<span className="mx_MessageTimestamp" title={ DateUtils.formatFullDate(date) }>
|
<span className="mx_MessageTimestamp" title={ DateUtils.formatFullDate(date) }>
|
||||||
{ DateUtils.formatTime(date) }
|
{ DateUtils.formatTime(date) }
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
.mx_EventTile_selected .mx_EventTile_line {
|
.mx_EventTile_selected .mx_EventTile_line {
|
||||||
border-left: $accent-color 5px solid;
|
border-left: $accent-color 5px solid;
|
||||||
padding-left: 60px;
|
padding-left: 100px;
|
||||||
background-color: $event-selected-color;
|
background-color: $event-selected-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,6 +263,10 @@ limitations under the License.
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx_EventTile_e2eIcon_12hr {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.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;
|
||||||
|
|
Loading…
Reference in New Issue