Fixed issue 26243: The time inserted in abs time field is not changed anymore
authorDavid Baz Fayos <david.baz@openbravo.com>
Mon, 14 Apr 2014 14:38:22 +0200
changeset 22914 cae716b1b753
parent 22913 7b986e0bf0ef
child 22915 e38cdd54b4f3
Fixed issue 26243: The time inserted in abs time field is not changed anymore
if the input lose the focus when the current DST is different than 1-1-1970
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js	Mon Apr 14 18:00:50 2014 +0530
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js	Mon Apr 14 14:38:22 2014 +0200
@@ -93,14 +93,20 @@
       value = isc.Time.parseInput(value);
     }
     if (value && isc.isA.Date(value)) {
+      if (this.isAbsoluteTime) {
+        value = OB.Utilities.Date.addTimezoneOffset(value);
+      }
       this.setTodaysDate(value);
+      if (this.isAbsoluteTime) {
+        value = OB.Utilities.Date.substractTimezoneOffset(value);
+      }
     }
     return this.Super('setValue', arguments);
   },
 
   getValue: function () {
     var value = this.Super('getValue', arguments);
-    if (value && isc.isA.Date(value)) {
+    if (value && isc.isA.Date(value) && !this.isAbsoluteTime) {
       this.setTodaysDate(value);
     }
     return value;