Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 4804fb3

Browse files
committed
Revert "Fix performance issues with wantsDateSeperator"
This change broke timezone handling, so that date-separators are shown at the wrong time of day. This reverts commit b908e7e.
1 parent a014dcc commit 4804fb3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/structures/MessagePanel.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ var sdk = require('../../index');
2121

2222
var MatrixClientPeg = require('../../MatrixClientPeg')
2323

24-
const MILLIS_IN_DAY = 86400000;
25-
2624
/* (almost) stateless UI component which builds the event tiles in the room timeline.
2725
*/
2826
module.exports = React.createClass({
@@ -477,7 +475,9 @@ module.exports = React.createClass({
477475
// here.
478476
return !this.props.suppressFirstDateSeparator;
479477
}
480-
return Math.floor(prevEvent.getTs() / MILLIS_IN_DAY) !== Math.floor(nextEventTs / MILLIS_IN_DAY);
478+
479+
return (new Date(prevEvent.getTs()).toDateString()
480+
!== new Date(nextEventTs).toDateString());
481481
},
482482

483483
// get a list of read receipts that should be shown next to this event

0 commit comments

Comments
 (0)