You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2016/04/17 22:44:28 UTC

svn commit: r1739651 - /qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/CriteriaPane.js

Author: orudyy
Date: Sun Apr 17 20:44:28 2016
New Revision: 1739651

URL: http://svn.apache.org/viewvc?rev=1739651&view=rev
Log:
QPID-6983: Use to_date function with datetime conditions

Modified:
    qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/CriteriaPane.js

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/CriteriaPane.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/CriteriaPane.js?rev=1739651&r1=1739650&r2=1739651&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/CriteriaPane.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/CriteriaPane.js Sun Apr 17 20:44:28 2016
@@ -77,17 +77,17 @@ function(declare, array, lang, string, d
 
     var sqlEscape =                    function(value)
                                        {
-                                         return value.replace("'", "'''");
+                                         return value.replace(/'/g, "'''");
                                        }
 
     var sqlLikeEscape =                function(value)
                                        {
-                                         return sqlEscape(value).replace("%", "\\%").replace("_", "\\_");
+                                         return sqlEscape(value).replace(/%/g, "\\%").replace(/_/g, "\\_");
                                        }
 
     var sqlValue =                     function(value, type)
                                        {
-                                         return (isNumericType(type) || type === "Boolean") ? value : "'" + sqlEscape(value) + "'"
+                                         return (isNumericType(type) || type === "Boolean" || type === "Date") ? value : "'" + sqlEscape(value) + "'"
                                        }
 
     var isNumericType =                function(type)
@@ -371,7 +371,7 @@ function(declare, array, lang, string, d
                                                        {
                                                          var time = this.timeEditor.value;
                                                          var value = date.getTime() + (time ? time.getTime() : 0) ;
-                                                         this.value = new Date(value).toISOString();
+                                                         this.value = "to_date('" + new Date(value).toISOString() + "')";
                                                          this.emit("change", this.value);
                                                        }
                                                      },



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org