From 4804fb3a1c32cfd12c179b5a47d712275454b5e8 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 21 Dec 2016 09:48:41 +0000 Subject: [PATCH] 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 b908e7ef29bfcbfbd6627ff4881693bb70b1db8a. --- src/components/structures/MessagePanel.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index ff25a4e35a..c681f5105d 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -21,8 +21,6 @@ var sdk = require('../../index'); var MatrixClientPeg = require('../../MatrixClientPeg') -const MILLIS_IN_DAY = 86400000; - /* (almost) stateless UI component which builds the event tiles in the room timeline. */ module.exports = React.createClass({ @@ -477,7 +475,9 @@ module.exports = React.createClass({ // here. 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