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 b908e7ef29.
This commit is contained in:
Richard van der Hoff 2016-12-21 09:48:41 +00:00
parent a014dcc2d0
commit 4804fb3a1c

View file

@ -21,8 +21,6 @@ var sdk = require('../../index');
var MatrixClientPeg = require('../../MatrixClientPeg') var MatrixClientPeg = require('../../MatrixClientPeg')
const MILLIS_IN_DAY = 86400000;
/* (almost) stateless UI component which builds the event tiles in the room timeline. /* (almost) stateless UI component which builds the event tiles in the room timeline.
*/ */
module.exports = React.createClass({ module.exports = React.createClass({
@ -477,7 +475,9 @@ module.exports = React.createClass({
// here. // here.
return !this.props.suppressFirstDateSeparator; return !this.props.suppressFirstDateSeparator;
} }
return Math.floor(prevEvent.getTs() / MILLIS_IN_DAY) !== Math.floor(nextEventTs / MILLIS_IN_DAY);
return (new Date(prevEvent.getTs()).toDateString()
!== new Date(nextEventTs).toDateString());
}, },
// get a list of read receipts that should be shown next to this event // get a list of read receipts that should be shown next to this event