PLT-3202 Re-render timestamps when display settings switch between 12h and 24h (#3337)
* Made post timestamp switch from 12h to 24h without refreshing * Made RHS post timestamps switch from 12h to 24h without refreshing
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
3f4d38f58a
Коммит
ba77aefe02
@@ -38,6 +38,11 @@ export default class RhsComment extends React.Component {
|
||||
if (nextProps.compactDisplay !== this.props.compactDisplay) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nextProps.useMilitaryTime !== this.props.useMilitaryTime) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Utils.areObjectsEqual(nextProps.post, this.props.post)) {
|
||||
return true;
|
||||
}
|
||||
@@ -231,7 +236,7 @@ export default class RhsComment extends React.Component {
|
||||
day='numeric'
|
||||
month='long'
|
||||
year='numeric'
|
||||
hour12={!Utils.isMilitaryTime()}
|
||||
hour12={!this.props.useMilitaryTime}
|
||||
hour='2-digit'
|
||||
minute='2-digit'
|
||||
/>
|
||||
@@ -259,5 +264,6 @@ RhsComment.propTypes = {
|
||||
post: React.PropTypes.object,
|
||||
user: React.PropTypes.object.isRequired,
|
||||
currentUser: React.PropTypes.object.isRequired,
|
||||
compactDisplay: React.PropTypes.bool
|
||||
compactDisplay: React.PropTypes.bool,
|
||||
useMilitaryTime: React.PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
Ссылка в новой задаче
Block a user