Pman.Gnumeric.js
[Pman.Core] / Pman.Gnumeric.js
index 2a608ad..a16b548 100644 (file)
@@ -1383,27 +1383,24 @@ 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.getAttribute('Format')) != 'undefined' && 
-                        g.styles[0].firstElementChild.getAttribute('Format') == "D\-MMM\-YYYY;@"
-                ){
-                    Roo.log(value);
-                    value = 'test';
+                try {
+                    if(
+                        g.styles[0].firstElementChild.getAttribute('Format') == "D\\-MMM\\-YYYY;@" &&
+                        g.value[0] != '='
+                    ){
+                        var vv = new Date(value);
+                        
+                        if(!isNaN(vv.getTime())){
+                            value = (vv.getTime() / 24 / 60 / 60 / 1000) + new Date('1900-01-01').getTime();
+                        }
+                    }
+                    
+                } 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;' +