Fixes issue 27202: AbsoluteDateTime properties are formatted in the identifier
authorAugusto Mauch <augusto.mauch@openbravo.com>
Mon, 04 Aug 2014 11:24:21 +0200
changeset 24155 28068c12e140
parent 24154 7507a81f4e63
child 24156 4f449d9a56f7
Fixes issue 27202: AbsoluteDateTime properties are formatted in the identifier

The getIdentifier method of the IdentifierProvider class was only formatting the dates of the properties that used the Date or DateTime references. Now it also applies the proper date format for the properties that use the AbsoluteDateTime reference.
src/org/openbravo/base/structure/IdentifierProvider.java
--- a/src/org/openbravo/base/structure/IdentifierProvider.java	Mon Aug 04 09:51:01 2014 +0200
+++ b/src/org/openbravo/base/structure/IdentifierProvider.java	Mon Aug 04 11:24:21 2014 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2013 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2014 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -150,7 +150,7 @@
       } else if (value != null) {
 
         // TODO: add number formatting...
-        if (property.isDate() || property.isDatetime()) {
+        if (property.isDate() || property.isDatetime() || property.isAbsoluteDateTime()) {
           value = formatDate(property, (Date) value);
         }
 
@@ -179,7 +179,7 @@
       dateFormat = new SimpleDateFormat(dateFormatString);
       dateTimeFormat = new SimpleDateFormat(dateTimeFormatString);
     }
-    if (property.isDatetime()) {
+    if (property.isDatetime() || property.isAbsoluteDateTime()) {
       return dateTimeFormat.format(date);
     } else {
       return dateFormat.format(date);