Fixes issue 24454: Datetime fields can be edited
authorAugusto Mauch <augusto.mauch@openbravo.com>
Wed, 31 Jul 2013 11:40:49 +0200
changeset 21017 21552ea1e111
parent 20690 895ac3b1f59a
child 21018 adf5086f4a24
Fixes issue 24454: Datetime fields can be edited

The problem was that at one point the date format was being used to format a datetime value. Depending on the type of value (date or datetime), a different format needs to be used.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js	Mon Jul 15 04:41:54 2013 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js	Wed Jul 31 11:40:49 2013 +0200
@@ -273,7 +273,7 @@
 
     //Setting the value to the textual value in case text field is changed. Fixes Issue https://issues.openbravo.com/view.php?id=22381
     if (this.textField._textChanged && this.textField.getValue() && (this.textField.getValue() !== value)) {
-      value = OB.Utilities.Date.OBToJS(this.textField.getValue(), this.dateFormat);
+      value = OB.Utilities.Date.OBToJS(this.textField.getValue(), (this.showTime ? OB.Format.dateTime : OB.Format.date));
     }
 
     ret = this.Super('setValue', newArguments);