diff --git a/css/converse.css b/css/converse.css index 885ec1ec1..ce216ad66 100644 --- a/css/converse.css +++ b/css/converse.css @@ -1347,7 +1347,7 @@ font-weight: bold; } #conversejs .chatbox .chat-body .chat-info.chat-date { display: inline-block; - margin-top: 2em; } + margin-top: 1em; } #conversejs .chatbox .chat-body .chat-message { margin: 0.3em; } #conversejs .chatbox .chat-body .chat-message span { diff --git a/docs/CHANGES.md b/docs/CHANGES.md index 9875b8362..0d674fde5 100755 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -1,9 +1,10 @@ # Changelog -## 1.0.2 (Unreleased) +## 1.0.3 (Unreleased) - Bugfix. Login form doesn't render after logging out, when `auto_reconnect = false` [jcbrand] +- Also indicate new day for the first day's messages. [jcbrand] ## 1.0.2 (2016-05-24) diff --git a/sass/_chatbox.scss b/sass/_chatbox.scss index 73edbb152..810bea6e3 100644 --- a/sass/_chatbox.scss +++ b/sass/_chatbox.scss @@ -151,7 +151,7 @@ } &.chat-date { display: inline-block; - margin-top: 2em; + margin-top: 1em; } } .chat-message { diff --git a/spec/chatbox.js b/spec/chatbox.js index aa2f3e9f8..b40f7d183 100644 --- a/spec/chatbox.js +++ b/spec/chatbox.js @@ -664,6 +664,12 @@ sender_txt = $chat_content.find('span.chat-msg-them').text(); expect(sender_txt.match(/^[0-9][0-9]:[0-9][0-9] /)).toBeTruthy(); + var $time = $chat_content.find('time'); + expect($time.length).toEqual(1); + expect($time.attr('class')).toEqual('chat-info chat-date'); + expect($time.data('isodate')).toEqual(moment(one_day_ago.startOf('day')).format()); + expect($time.text()).toEqual(moment(one_day_ago.startOf('day')).format("dddd MMM Do YYYY")); + message = 'This is a current message'; msg = $msg({ from: contact_jid, @@ -676,12 +682,13 @@ expect(converse.emit).toHaveBeenCalledWith('message', msg); // Check that there is a