diff --git a/package.json b/package.json
index d395076c82..61fb440c54 100644
--- a/package.json
+++ b/package.json
@@ -75,7 +75,6 @@
"react-dnd-html5-backend": "^2.1.2",
"react-dom": "^15.6.0",
"react-gemini-scrollbar": "matrix-org/react-gemini-scrollbar#5e97aef",
- "react-sticky": "^6.0.1",
"sanitize-html": "^1.11.1",
"text-encoding-utf-8": "^1.0.1",
"ua-parser-js": "^0.7.10",
diff --git a/src/components/views/messages/DateSeparator.js b/src/components/views/messages/DateSeparator.js
index 525f8a5968..84d63dd5ff 100644
--- a/src/components/views/messages/DateSeparator.js
+++ b/src/components/views/messages/DateSeparator.js
@@ -15,26 +15,45 @@ limitations under the License.
*/
import React from 'react';
+import { _t } from 'matrix-react-sdk/lib/languageHandler';
import DateUtils from 'matrix-react-sdk/lib/DateUtils';
-import { Sticky } from 'react-sticky';
+
+function getdaysArray() {
+ return [
+ _t('Sunday'),
+ _t('Monday'),
+ _t('Tuesday'),
+ _t('Wednesday'),
+ _t('Thursday'),
+ _t('Friday'),
+ _t('Saturday'),
+ ];
+}
module.exports = React.createClass({
displayName: 'DateSeparator',
render: function() {
- const date = new Date(this.props.ts);
- const label = DateUtils.formatDateSeparator(date);
+ var date = new Date(this.props.ts);
+ var today = new Date();
+ var yesterday = new Date();
+ var days = getdaysArray();
+ yesterday.setDate(today.getDate() - 1);
+ var label;
+ if (date.toDateString() === today.toDateString()) {
+ label = _t('Today');
+ }
+ else if (date.toDateString() === yesterday.toDateString()) {
+ label = _t('Yesterday');
+ }
+ else if (today.getTime() - date.getTime() < 6 * 24 * 60 * 60 * 1000) {
+ label = days[date.getDay()];
+ }
+ else {
+ label = DateUtils.formatFullDate(date, this.props.showTwelveHour);
+ }
+
return (
- { label }
-