Date time

say i want to create a resource via json api post request that has an attribute of type :utc_datetime_usec, since the value is received as a string how can i convert the string to DateTime inside the create action of the resource, i assumed there is auto cast, however it seem to not work?
2 Replies
ZachDaniel
ZachDaniel2y ago
It should cast ISO 8601 compliant strings you can test this out in iex using Ash.Type.cast_input/3 You can also add an argument with the same name as the attribute to your actions and make that a :string and parse the datetime however you like
sisk
siskOP2y ago
thank you let me try it out

Did you find this page helpful?