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-customer.git

commit dfad7e2f347bd6838249a790aa299bfbaed4a739
Author: mgeiss <[email protected]>
AuthorDate: Tue Oct 24 07:01:32 2017 -0400

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

diff --git a/component-test/src/main/java/io/mifos/customer/TestCustomer.java 
b/component-test/src/main/java/io/mifos/customer/TestCustomer.java
index f5e53f3..66dc41e 100644
--- a/component-test/src/main/java/io/mifos/customer/TestCustomer.java
+++ b/component-test/src/main/java/io/mifos/customer/TestCustomer.java
@@ -218,7 +218,7 @@ public class TestCustomer extends AbstractCustomerTest {
   @Test
   public void shouldUnlockClient() throws Exception {
     final Customer customer = CustomerGenerator.createRandomCustomer();
-    final String applicationDate = 
DateConverter.toIsoString(LocalDate.now(Clock.systemUTC()));
+    final String applicationDate = 
DateConverter.toIsoString(LocalDate.now(Clock.systemUTC())).substring(0, 10);
     customer.setApplicationDate(applicationDate);
     this.customerManager.createCustomer(customer);
 
diff --git 
a/service/src/main/java/io/mifos/customer/service/internal/mapper/CustomerMapper.java
 
b/service/src/main/java/io/mifos/customer/service/internal/mapper/CustomerMapper.java
index 6cf7569..2e8f867 100644
--- 
a/service/src/main/java/io/mifos/customer/service/internal/mapper/CustomerMapper.java
+++ 
b/service/src/main/java/io/mifos/customer/service/internal/mapper/CustomerMapper.java
@@ -46,7 +46,13 @@ public final class CustomerMapper {
     customerEntity.setAssignedEmployee(customer.getAssignedEmployee());
     customerEntity.setCurrentState(customer.getCurrentState());
     if (customer.getApplicationDate() != null) {
-      
customerEntity.setApplicationDate(DateConverter.dateFromIsoString(customer.getApplicationDate()));
+      final String editedApplicationDate;
+      if (!customer.getApplicationDate().endsWith("Z")) {
+        editedApplicationDate = customer.getApplicationDate() + "Z";
+      } else {
+        editedApplicationDate = customer.getApplicationDate();
+      }
+      
customerEntity.setApplicationDate(DateConverter.dateFromIsoString(editedApplicationDate));
     }
     customerEntity.setCreatedBy(UserContextHolder.checkedGetUser());
     customerEntity.setCreatedOn(LocalDateTime.now(Clock.systemUTC()));
@@ -68,7 +74,9 @@ public final class CustomerMapper {
     customer.setAssignedEmployee(customerEntity.getAssignedEmployee());
     customer.setCurrentState(customerEntity.getCurrentState());
     if (customerEntity.getApplicationDate() != null) {
-      
customer.setApplicationDate(DateConverter.toIsoString(customerEntity.getApplicationDate()));
+      final String editedApplicationDate =
+          
DateConverter.toIsoString(customerEntity.getApplicationDate()).substring(0, 10);
+      customer.setApplicationDate(editedApplicationDate);
     }
     customer.setCreatedBy(customerEntity.getCreatedBy());
     
customer.setCreatedOn(DateConverter.toIsoString(customerEntity.getCreatedOn()));

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to