API Docs for: 0.2.1
Show:

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')

Methods

deserializeDateAttribute

(
  • date
)
Date | Null

Parameters:

  • date String

    usually in ISO format, must be a valid argument for Date

Returns:

Date | Null:

date value from JSON payload, or null

serializeDateAttribute

(
  • date
)
String | Null

Parameters:

  • date Date | String

Returns:

String | Null:

date value as ISO String for JSON payload, or null