From 07f5e61f17ebc5a68de9a4c9acdc069f4594c62f Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Thu, 26 Mar 2015 12:44:52 +0000
Subject: [PATCH] Disable deletes and fix date format from comments widget
 (From Review Meeting)

SVN: 33748
---
 .../1/as/webapps/newbrowser/html/js/util/Util.js    | 13 ++++++++++++-
 .../js/views/SampleForm/widgets/CommentsView.js     |  8 +++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/util/Util.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/util/Util.js
index beee894519a..b942fd799f7 100644
--- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/util/Util.js
+++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/util/Util.js
@@ -299,11 +299,22 @@ var Util = new function() {
 	//
 	this.getFormatedDate = function(date) {
 		var day = date.getDate();
+		if(day < 10) {
+			day = "0" + day;
+		}
 		var month = date.getMonth();
+		if(month < 10) {
+			month = "0" + month;
+		}
 		var year = date.getFullYear();
 		var hour = date.getHours();
+		if(hour < 10) {
+			hour = "0" + hour;
+		}
 		var minute = date.getMinutes();
-		
+		if(minute < 10) {
+			minute = "0" + minute;
+		}
 		return day + "/" + month + "/" + year + " " + hour + ":" + minute;
 	}
 	
diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/CommentsView.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/CommentsView.js
index 395639516da..3d446922646 100644
--- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/CommentsView.js
+++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/CommentsView.js
@@ -53,7 +53,13 @@ function CommentsView(commentsController, commentsModel) {
 			$buttonDelete.append($("<span>", { "class" : "glyphicon glyphicon-minus-sign"}));
 		}
 		var date = Util.getFormatedDate(new Date(parseInt(dateValue) * 1000));
-		var commentWidget = FormUtil.getFieldForLabelWithText(date + " (" + userId + ")", value, null, $buttonDelete, 
+		
+		var deleteEnabled = false;
+		var $sufixComponent = null;
+		if(deleteEnabled) {
+			$sufixComponent = $buttonDelete;
+		}
+		var commentWidget = FormUtil.getFieldForLabelWithText(date + " (" + userId + ")", value, null, $sufixComponent, 
 				{ 
 					"background-color" : "lightblue",
 					"padding-left" : "18px",
-- 
GitLab