Hi,
So when Appian writes dates to Json, it cannot cast those values correctly if it reads them back.
load( local!data:{ today() }, local!jsonData: a!toJson( local!data ), local!fromJson: cast( typeof(today()), a!fromJson( local!jsonData ) ), a!sectionLayout( contents: { a!textField( value: local!jsonData ), a!textField( value: local!fromJson ) } ) )
Do I have to manually alter the string in order to reorder the date from "YYYY-MM-DDZ" to "DD-MM-YYYYZ" before I run from Json?
Is there a reason that Appian designed it this way?
Discussion posts and replies are publicly visible
Hi jonathanb0001
You can try this approach (work for 17.4 at least):
with( local!listOfDates: {now(),today()-1,today()+7}, local!jsonString: a!toJson( { /* ... */ dateValues: cast('type!Text?list', a!forEach(local!listOfDates,text(fv!item,"mm/dd/yyyy")) ) /* ... */ } ), local!jsonObject: a!fromJson(local!jsonString), local!dateValues: cast('type!Date?list', property(local!jsonObject,"dateValues",null)), local!dateValues )