2

I'm working with JS-Data and I would love to figure out the best way to go about writing a validator / formatter potentially for the Schema to handle date strings as moment objects. It would be great if I could validate a date property as a moment object, and then serialize / deserialize using moment to manage all date / time objects

Has anyone tackled this with JS-Data?

Jordan
  • 2,393
  • 4
  • 30
  • 60

1 Answers1

2

You can accomplish this in the lifecycle hooks ie beforeCreate and beforeUpdate

Cory Robinson
  • 4,616
  • 4
  • 36
  • 53