Custom serializer for date returned by server


My back end returns a published field for a post in the form yyyy-mm-dd. For the urls in Ember, I need to pass the year, month and day (with the slug as well) eg


I’ve tried extending the JSONAPISerializer class in order to adjust the payload from the server, but to no avail.

Any help much appreciated.

Many thanks

Sorted this. Added the three fields to the post model and extended normalizeResponse


export default ApplicationSerializer.extend({
   normalizeResponse(store,primaryModelClass,payload,id,requestType) { => {
		post.attributes.year = this.getYear(post.attributes.published);
		post.attributes.month = this.getMonth(post.attributes.published); = this.getDay(post.attributes.published);
	return this._super(...arguments);