TransformsMixin Class
A Mixin class for methods to transform resource attributes, includes date
attribute methods to serialize and deserialize the date(time) to/from
ISO Format for use with attr('date')
Any valid attribute type (string, boolean, number, object, array, date) can be added to your app, just generate a transforms mixin and define other types if needed, and use the type when defining a resource attribute, e.g. attr('array')
Item Index
Methods
deserializeDateAttribute
(
Date | Null
-
date
Parameters:
-
date
Stringusually in ISO format, must be a valid argument for Date
Returns:
Date | Null:
date value from JSON payload, or null
serializeDateAttribute
(
String | Null
-
date
Parameters:
-
date
Date | String
Returns:
String | Null:
date value as ISO String for JSON payload, or null