details:   https://code.openbravo.com/erp/devel/pi/rev/bdd43e2b23bd
changeset: 22888:bdd43e2b23bd
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Thu Apr 17 01:22:39 2014 +0200
summary:   [absref] Fixed issue 26287: Abs DateTime now display always the same 
value
whether the field be shown in grid view or not

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     |  5 +++++
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 |  7 +++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diffs (32 lines):

diff -r 2aa45e3949b4 -r bdd43e2b23bd 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Wed Apr 16 18:39:51 2014 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Thu Apr 17 01:22:39 2014 +0200
@@ -1041,6 +1041,11 @@
         }
       } else if (isAbsoluteDateTime) {
         jsDateTime = isc.Date.parseStandardDate(columnValue.value);
+        // In the case of an absolute datetime, it needs to be converted in 
order to avoid the UTC conversion
+        // http://forums.smartclient.com/showthread.php?p=116135
+        if (Object.prototype.toString.call(jsDateTime) === '[object Date]') {
+          jsDateTime = OB.Utilities.Date.substractTimezoneOffset(jsDateTime);
+        }
         this.setItemValue(field.name, jsDateTime);
         if (field.textField) {
           delete field.textField._textChanged;
diff -r 2aa45e3949b4 -r bdd43e2b23bd 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Wed Apr 16 18:39:51 2014 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Thu Apr 17 01:22:39 2014 +0200
@@ -2249,6 +2249,13 @@
         propertyObj = properties[i];
         value = record[propertyObj.property];
         field = component.getField(propertyObj.property);
+        if (field && field.editorType //
+        && Object.prototype.toString.call(value) === '[object Date]' //
+        && new Function('return isc.' + field.editorType + 
'.getPrototype().isAbsoluteDateTime')()) { //
+          // In the case of an absolute datetime, it needs to be converted in 
order to avoid the UTC conversion
+          // http://forums.smartclient.com/showthread.php?p=116135
+          value = OB.Utilities.Date.addTimezoneOffset(value);
+        }
         addProperty = propertyObj.sessionProperty || !onlySessionProperties;
         if (addProperty) {
           if (classicMode) {

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to