My Companies

Ember Data is a persistence layer for Ember.Js. Without any configuration, Ember Data can load and save records and their relationships served via a RESTful JSON API, provided it follows certain conventions.

By default, Date in Ember Data is serialised to a UNIX timestamp. This is great for some backends, but it might be more suitable for some to deal with textual date formats like the ISO 8601. Fortunately, Ember Data makes it really easy to define custom transformers for serialising and deserializing stuff with REST requests.

To have an isodate transformer in Ember Data, all you need is the following:

Now, you can define dates in your models with DS.attr('isodate'). Here I am using the wonderful Moment.js library for handling dates. You would, of course need to modify the definitions accordingly if you decide not to use it.