From a110444d1bc0391b626cd66cfd63e55e02bc4059 Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Fri, 5 Jan 2018 13:35:21 +0530 Subject: [PATCH 1/3] [MIN] Fix datetime creation --- frappe/public/js/frappe/chat.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frappe/public/js/frappe/chat.js b/frappe/public/js/frappe/chat.js index b51b6451e9..7dd5417fd7 100644 --- a/frappe/public/js/frappe/chat.js +++ b/frappe/public/js/frappe/chat.js @@ -949,14 +949,14 @@ frappe.chat.pretty_datetime = function (date) { const today = moment() const instance = date.moment - + if ( today.isSame(instance, "d") ) - return today.format("hh:mm A") + return instance.format("hh:mm A") else if ( today.isSame(instance, "week") ) - return today.format("dddd") + return instance.format("dddd") else - return today.format("DD/MM/YYYY") + return instance.format("DD/MM/YYYY") } // frappe.chat.sound @@ -1931,7 +1931,9 @@ class extends Component } if ( props.last_message ) + { item.timestamp = frappe.chat.pretty_datetime(props.last_message.creation) + } return ( h("li", null, From 5e705983c9ce12a67f6344e9bae392ecb463609e Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Fri, 5 Jan 2018 13:36:18 +0530 Subject: [PATCH 2/3] [MIN] Fix datetime creation --- frappe/public/js/frappe/chat.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/frappe/public/js/frappe/chat.js b/frappe/public/js/frappe/chat.js index 7dd5417fd7..e4dcb1d522 100644 --- a/frappe/public/js/frappe/chat.js +++ b/frappe/public/js/frappe/chat.js @@ -1931,9 +1931,7 @@ class extends Component } if ( props.last_message ) - { item.timestamp = frappe.chat.pretty_datetime(props.last_message.creation) - } return ( h("li", null, From 5a3e8174137f92ac9cfe9dbf9f3fdad6b63a196a Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Fri, 5 Jan 2018 13:48:56 +0530 Subject: [PATCH 3/3] fix this.action.primary being empty --- frappe/public/js/frappe/ui/dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/ui/dialog.js b/frappe/public/js/frappe/ui/dialog.js index 7fc5da03ae..895a645563 100644 --- a/frappe/public/js/frappe/ui/dialog.js +++ b/frappe/public/js/frappe/ui/dialog.js @@ -34,7 +34,7 @@ frappe.ui.Dialog = frappe.ui.FieldGroup.extend({ // show footer this.action = this.action || { primary: { }, secondary: { } }; - if(this.primary_action || this.action.primary.label) { + if(this.primary_action || !frappe._.is_empty(this.action.primary)) { this.set_primary_action(this.primary_action_label || this.action.primary.label || __("Submit"), this.primary_action || this.action.primary.click); }