Resolved Policy GUI Issues
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / controller / CreateBRMSRawController.java
index 9851d31..b08761b 100644 (file)
@@ -141,7 +141,8 @@ public class CreateBRMSRawController{
                                                                                        policyAdapter.setGuard(value);
                                                                                }
                                                                                if (attributeId.equals("TTLDate") && !value.contains("NA")){
-                                                                                       String newDate = convertDate(value, true);
+                                                                                       PolicyController controller = new PolicyController();
+                                                                                       String newDate = controller.convertDate(value);
                                                                                        policyAdapter.setTtlDate(newDate);
                                                                                }
                                                                        }
@@ -154,19 +155,4 @@ public class CreateBRMSRawController{
                } 
        }
 
-       private String convertDate(String dateTTL, boolean portalType) {
-               String formateDate = null;
-               String[] date;
-               String[] parts;
-               
-               if (portalType){
-                       parts = dateTTL.split("-");
-                       formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z";
-               } else {
-                       date  = dateTTL.split("T");
-                       parts = date[0].split("-");
-                       formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
-               }
-               return formateDate;
-       }
 }