Date Formatter in JSON

Contains a function that can be used when sending data in JSON format e.g. storing or updating data in a database using Web API to convert date formats.  This listing contains the modifyjsondata() function and instructions on how to use the function. Works with any format of Date / Date Time conversion, given that the provided date / date time format as an input to this plug-in is correct as per the JSON. It can also modify list of Date attributes of the JSONObject / JSONArray at a time (e.g. createdOn (Date), modifiedOn (Date)), instead of doing it one after the another.

NOTES:

  • Please avoid the usage of an explicit dictionary key while passing a JSON String to this plug-in. Example:
    • {"EmployeeDetails": [{"id": "1", "name": "Demo"}, {"id": "2", "name": "Demo1"}]} , Here "EmployeeDetails" is the explicit dictionary Key,
    • Instead please pass it as below: [{"id": "1", "dob": "01-02-2019"}, {"id": "2", "dob": "15-07-2019"}] -- Here this JsonArray is converted using the existing CDT Array i.e. toJson(YOUR_CDT/YOUR_CDT_ARRAY)
  • Please avoid the usage of this plug-in, if you want to modify a Date / Date Time property of a Child CDT (Nested) through the parent. Example:
    • EmployeeDetails.PersonalDetails.DOB, Here EmployeeDetails is the parent and PersonalDetails is the child (Nested CDT) But if your date property, the part of your parent CDT i.e. EmployeeDetails.DOB then you can use this plug-in to perform the conversion.
Anonymous