Changed dates

bzr revid: nicolas.vanhoren@openerp.com-20121204164330-1h2dr0wcc2txouo3
This commit is contained in:
niv-openerp
2012-12-04 17:43:30 +01:00
parent 17b0be4505
commit 8e1eb820f1
2 changed files with 16 additions and 2 deletions
+8 -1
View File
@@ -190,6 +190,7 @@
}
.openerp .oe_im_chatview .oe_im_chatview_bubble {
background: white;
position: relative;
padding: 3px;
margin: 3px;
-moz-border-radius: 3px;
@@ -219,17 +220,23 @@
-ms-interpolation-mode: bicubic;
}
.openerp .oe_im_chatview .oe_im_chatview_time {
position: absolute;
right: 0px;
top: 0px;
margin: 3px;
text-align: right;
line-height: 13px;
font-size: 11px;
color: #999;
width: 60px;
overflow: hidden;
}
.openerp .oe_im_chatview .oe_im_chatview_from {
margin: 0 0 2px 0;
line-height: 14px;
font-weight: bold;
font-size: 12px;
width: 154px;
width: 140px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
+8 -1
View File
@@ -367,7 +367,14 @@ openerp.web_im = function(instance) {
this.last_user = user;
this.last_items = items;
date = instance.web.str_to_datetime(date);
date = date.toString(Date.CultureInfo.formatPatterns.shortDate + " " + Date.CultureInfo.formatPatterns.shortTime);
var now = new Date();
var diff = now - date;
if (diff > (1000 * 60 * 60 * 24)) {
date = $.timeago(date);
} else {
date = date.toString(Date.CultureInfo.formatPatterns.shortTime);
}
this.last_bubble = $(QWeb.render("Conversation.bubble", {"items": items, "user": user, "time": date}));
$(this.$(".oe_im_chatview_content").children()[0]).append(this.last_bubble);
this._go_bottom();