I want to format the date that is stored in variable called "value"
%dw 2.0
output application/json
var value = "202206"
---
{
"date": value as String {format: "yyyyMM"} as String {format: "yyyy-MM-01"},
"month": value as String {format: "yyyyMM"} as String {format: "MMMM"},
}
I need the output like this
{
"date": "2022-06-01",
"month": "June"
}
I know it can be done, but I cant seem to figure it out.