mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
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);
|
||||||
return (
|
if (UserSettingsStore.getSyncedSetting('showTwelveHourTimestamps')) {
|
||||||
<span className="mx_MessageTimestamp" title={ DateUtils.formatFullDate(date) }>
|
return (
|
||||||
{ DateUtils.formatTime(date) }
|
<span style={{ textAlign: 'center' }} className="mx_MessageTimestamp" title={ DateUtils.formatFullDate(date) }>
|
||||||
</span>
|
{ DateUtils.formatTime(date) }
|
||||||
);
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (
|
||||||
|
<span className="mx_MessageTimestamp" title={ DateUtils.formatFullDate(date) }>
|
||||||
|
{ DateUtils.formatTime(date) }
|
||||||
|
</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
Block a user