Best answer

CLI: Transforming type date, numeric from inputData to correct formats

  • 27 April 2022
  • 1 reply
  • 98 views

Hey,

I’ve created some dynamic fields:
 

[
{
"key":"date",
"label":"Date",
"type":"datetime"
},
{
"key":"number",
"label":"Number",
"type":"number"
}
]

now datetime will be returned in ISO8601 but our API only allows dates in RFC 3339 format.
That’s why I want to transform the ISO8601 to RCF 3339 but in my “perform”-method I only receive in “bundle” the “inputData” but not the type of the fields.

Is there a way in which I can know in my “perform”-method of which fieldType the inputData is?
Something like:

{
"inputData":{
"date":{
"type":"datetime",
"value":"2022-04-27T11:11:27+02:00"
},
"number":{
"type":"number",
"value":6
}
}
}


 

icon

Best answer by Development Flexmail 27 April 2022, 14:59

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

I’ve fixed it with https://moment.github.io/luxon/#/ . With this libary I can detect if a string is iso8601 and then transform this string into RFC 3339