diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index e2e203f680..44c4051995 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -295,16 +295,6 @@ module.exports = WithMatrixClient(React.createClass({ const receiptOffset = 15; let left = 0; - // It's possible that the receipt was sent several days AFTER the event. - // If it is, we want to display the complete date along with the HH:MM:SS, - // rather than just HH:MM:SS. - let dayAfterEvent = new Date(this.props.mxEvent.getTs()); - dayAfterEvent.setDate(dayAfterEvent.getDate() + 1); - dayAfterEvent.setHours(0); - dayAfterEvent.setMinutes(0); - dayAfterEvent.setSeconds(0); - let dayAfterEventTime = dayAfterEvent.getTime(); - var receipts = this.props.readReceipts || []; for (var i = 0; i < receipts.length; ++i) { var receipt = receipts[i]; @@ -340,7 +330,6 @@ module.exports = WithMatrixClient(React.createClass({ suppressAnimation={this._suppressReadReceiptAnimation} onClick={this.toggleAllReadAvatars} timestamp={receipt.ts} - showFullTimestamp={receipt.ts >= dayAfterEventTime} /> ); } diff --git a/src/components/views/rooms/ReadReceiptMarker.js b/src/components/views/rooms/ReadReceiptMarker.js index 230efbd1ea..0911d50c3e 100644 --- a/src/components/views/rooms/ReadReceiptMarker.js +++ b/src/components/views/rooms/ReadReceiptMarker.js @@ -24,6 +24,8 @@ var sdk = require('../../../index'); var Velociraptor = require('../../../Velociraptor'); require('../../../VelocityBounce'); +import DateUtils from '../../../DateUtils'; + var bounce = false; try { if (global.localStorage) { @@ -63,9 +65,6 @@ module.exports = React.createClass({ // Timestamp when the receipt was read timestamp: React.PropTypes.number, - - // True to show the full date/time rather than just the time - showFullTimestamp: React.PropTypes.bool, }, getDefaultProps: function() { @@ -170,16 +169,8 @@ module.exports = React.createClass({ let title; if (this.props.timestamp) { - const prefix = "Seen by " + this.props.member.userId + " at "; - let ts = new Date(this.props.timestamp); - if (this.props.showFullTimestamp) { - // "15/12/2016, 7:05:45 PM (@alice:matrix.org)" - title = prefix + ts.toLocaleString(); - } - else { - // "7:05:45 PM (@alice:matrix.org)" - title = prefix + ts.toLocaleTimeString(); - } + title = "Seen by " + this.props.member.userId + " at " + + DateUtils.formatDate(new Date(this.props.timestamp)); } return (