[Kimchi-devel] [PATCH ][Wok] Issue #116:No indication of debug reports being generated(Gingerbase)

atreyee at linux.vnet.ibm.com atreyee at linux.vnet.ibm.com
Mon Jun 27 12:42:46 UTC 2016


From: Atreyee Mukhopadhyay <atreyee at linux.vnet.ibm.com>

pending reports are masked with 'generating..' message which was
not getting parsed by locale datetime converter.invalid date message
was shown and pending report was not disabled for operations.
---
 ui/js/src/wok.utils.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ui/js/src/wok.utils.js b/ui/js/src/wok.utils.js
index 54f8cf0..afe4020 100644
--- a/ui/js/src/wok.utils.js
+++ b/ui/js/src/wok.utils.js
@@ -232,9 +232,14 @@ wok.notificationsLoop = function notificationsLoop() {
 }
 
 wok.datetimeLocaleConverter = function datetimeLocaleConverter(datetime_string, locale){
-   var dte = new Date(datetime_string.substr(0,10) + 'T' + datetime_string.substr(11));
-   var options = { year: 'numeric', month: 'long', day: 'numeric' };
-   return dte.toLocaleString(locale, options);
+   var dateRegEx = /(\d{4})-(\d{2})-(\d{2})/;
+   if(dateRegEx.test(datetime_string.substr(0,10))){
+     var dte = new Date(datetime_string.substr(0,10) + 'T' + datetime_string.substr(11));
+     var options = { year: 'numeric', month: 'long', day: 'numeric' };
+     return dte.toLocaleString(locale, options);
+  }else{
+    return datetime_string;
+  }
 }
 
 wok.dateLocaleConverter = function dateLocaleConverter(date_string, locale){
-- 
2.1.0




More information about the Kimchi-devel mailing list