fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From my...@apache.org
Subject [fineract-cn-deposit-account-management] 21/26: added time zone 'Z' handling to ease UI usage
Date Mon, 22 Jan 2018 15:49:43 GMT
This is an automated email from the ASF dual-hosted git repository.

myrle pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-deposit-account-management.git

commit 9680ecbb15747265d976c8fe6d8491f087c81b0a
Author: mgeiss <mgeiss@mifos.org>
AuthorDate: Tue Oct 24 07:00:47 2017 -0400

    added time zone 'Z' handling to ease UI usage
---
 .../src/main/java/io/mifos/deposit/TestProductInstance.java   |  2 +-
 .../service/internal/mapper/ProductInstanceMapper.java        | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/component-test/src/main/java/io/mifos/deposit/TestProductInstance.java b/component-test/src/main/java/io/mifos/deposit/TestProductInstance.java
index 6018d94..d3442ec 100644
--- a/component-test/src/main/java/io/mifos/deposit/TestProductInstance.java
+++ b/component-test/src/main/java/io/mifos/deposit/TestProductInstance.java
@@ -103,7 +103,7 @@ public class TestProductInstance extends AbstractDepositAccountManagementTest
{
     super.eventRecorder.wait(EventConstants.POST_PRODUCT_DEFINITION, productDefinition.getIdentifier());
 
     final ProductInstance productInstance = Fixture.productInstance(productDefinition.getIdentifier());
-    final String openedOn = "2013-05-08Z";
+    final String openedOn = "2013-05-08";
     productInstance.setOpenedOn(openedOn);
 
     super.depositAccountManager.create(productInstance);
diff --git a/service/src/main/java/io/mifos/deposit/service/internal/mapper/ProductInstanceMapper.java
b/service/src/main/java/io/mifos/deposit/service/internal/mapper/ProductInstanceMapper.java
index a841833..4073783 100644
--- a/service/src/main/java/io/mifos/deposit/service/internal/mapper/ProductInstanceMapper.java
+++ b/service/src/main/java/io/mifos/deposit/service/internal/mapper/ProductInstanceMapper.java
@@ -51,7 +51,13 @@ public class ProductInstanceMapper {
       }
 
       if (productInstance.getOpenedOn() != null) {
-        productInstanceEntity.setOpenedOn(DateConverter.dateFromIsoString(productInstance.getOpenedOn()));
+        final String editedOpenedDate;
+        if (!productInstance.getOpenedOn().endsWith("Z")) {
+          editedOpenedDate = productInstance.getOpenedOn() + "Z";
+        } else {
+          editedOpenedDate = productInstance.getOpenedOn();
+        }
+        productInstanceEntity.setOpenedOn(DateConverter.dateFromIsoString(editedOpenedDate));
       }
 
       if (productInstance.getLastTransactionDate() != null) {
@@ -79,7 +85,8 @@ public class ProductInstanceMapper {
     }
 
     if (productInstanceEntity.getOpenedOn() != null) {
-      productInstance.setOpenedOn(DateConverter.toIsoString(productInstanceEntity.getOpenedOn()));
+      final String editedOpenedDate = DateConverter.toIsoString(productInstanceEntity.getOpenedOn()).substring(0,
10);
+      productInstance.setOpenedOn(editedOpenedDate);
     }
 
     if (productInstanceEntity.getLastTransactionDate() != null) {

-- 
To stop receiving notification emails like this one, please contact
myrle@apache.org.

Mime
View raw message