Ember Fields

Date / Time


To format dates and times in your handlebars template, use ember-moment


For a Django model e.g:

created = models.DateTimeField()

To check the json returned by a Django API:

from api.tests.fixture import api_client, date_to_ember_iso

assert {
    "count": 1,
    "next": None,
    "previous": None,
    "results": [
            "id": note.pk,
            "created": date_to_ember_iso(note.created),
            "title": "Apple",
} == response.json()

The Ember model:

created: DS.attr('date'),