Resolved Policy GUI Issues
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / controller / CreateBRMSParamController.java
index 9104b98..fc7cb60 100644 (file)
@@ -337,27 +337,13 @@ public class CreateBRMSParamController extends RestrictedBaseController {
                                policyAdapter.setGuard(value);
                        }
                        if ("TTLDate".equals(attributeId) && !value.contains("NA")){
-                               String newDate = convertDate(value, true);
+                               PolicyController controller = new PolicyController();
+                               String newDate = controller.convertDate(value);
                                policyAdapter.setTtlDate(newDate);
                        }
                }
        }
 
-       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;
-       }
        // This method generates the UI from rule configuration
        public void paramUIGenerate(PolicyRestAdapter policyAdapter, PolicyEntity entity) {
                String data = entity.getConfigurationData().getConfigBody();