DataObjects/I18n.php
[Pman.Core] / Pman.Gnumeric.js
index 13be028..8a90aea 100644 (file)
@@ -454,7 +454,7 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
                 Roo.each(vv[1].split(':'), function(c) { col.push(Math.round(parseInt(c,16)/256)); })
                 ent['border-'+vv[0]+'-color'] = 'rgb(' + col.join(',') + ')';
             }
-        }
+        };
         function add(e, k, v) {
             //Roo.log(k,v);
             e.gstyle[k] = v;
@@ -982,7 +982,7 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
                  
             }
             
-        }
+        };
        
         var ent = {
                 HAlign:"1",
@@ -1032,7 +1032,7 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
                 if (v != 'italic') return;
                 ent['Italic'] = 1;
             } 
-        }
+        };
        
         var fent = {
             Unit:"10",
@@ -1383,27 +1383,20 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
                 
                 var value = g.value[0] == '=' ? 'CALCULATED' : g.value;
                 
-//                if(
-//                        typeof(g.styles.firstElementChild.attributes) != 'undefined' && 
-//                        typeof(g.styles.firstElementChild.attributes[12])
-//                ){
-//                    
-//                }
-                if(value == '01/Jan/2014'){
-                    Roo.log(g.styles[0].firstElementChild.getAttribute('Format'));
-                    Roo.log(value);
-                    Roo.log(typeof(value));
-                    Roo.log(typeof(g.styles[0].firstElementChild.attributes[12].value));
-                }
-                if(
-                        typeof(g.styles[0].firstElementChild.attributes[12].value) != 'undefined' && 
-                        g.styles[0].firstElementChild.attributes[12].value == "D\-MMM\-YYYY;@"
-                ){
-                    Roo.log(value);
-                    value = 'test';
+                try {
+                    if(
+                        g.styles[0].firstElementChild.getAttribute('Format') == "D\\-MMM\\-YYYY;@" &&
+                        g.value[0] != '=' &&
+                        !isNaN(value * 1) && 
+                        value != 0
+                    ){
+                        value = new Date(value * 24 * 60 * 60 * 1000 + new Date('1899-12-30').getTime()).format('d-M-Y');
+                    }
+                    
+                } catch(e) {
+                    
                 }
                 
-                
                 out+=String.format('<td colspan="{0}" rowspan="{1}"  class="{4}"><div style="{3}">{2}</div></td>', 
                     g.colspan, g.rowspan, value,
                     'overflow:hidden;' + 
@@ -1434,7 +1427,7 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
     {
         name = name || "Missing_download_filename";
         
-        if (this.downloadURL && this.downloadURL.charAt(this.downloadURL .length-1) != '/') {
+        if (this.downloadURL && this.downloadURL.charAt(this.downloadURL.length-1) != '/') {
             this.downloadURL += '/';
         }