Skip to content

String handling with Dates #394

@ahacking

Description

@ahacking

Currently I am working around an issue with Date/string handling as follows:

Em.Model.dataTypes[Date].serialize = function(date) {
  if (!date) {
    return null;
  }
  if (Em.typeOf(date) === 'string') {
    date = new Date(date);
  }
  return date.toISOString();
};

This may be similar/related to the number strings issue #347.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions