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
Perhaps, but from what I can find the recommended way to pass dates to JSON is through the ISO 8601 standard.
Appian does seem to agree somewhat with this given thats how it casts dates into a JSON format, so why does it expect them to be passed in differently.
Additionally what if this data isn't originating from the same Appian location but from an external source, I am not familiar with how Appian encodes dates to integers, is this an industry standard, so that I can ensure that the data is converted to integer in a way that Appian can reverse correctly.
Also this fails for datetimes, so it is kind of a hack.
a!textField( label: todatetime(tointeger(now())), value: todatetime(tointeger(today())) )
I think that when casting to integer Appian rounds the datetime value up to the closest date value and then converts that to integer.