I've added moment into my project and I would like to know how can I change the behavior of moment.fn.toJSON globally.
Currently, I'm using the constructor to do so and it works. But I don't want to paste this code in all of my controllers.
So here is an extract :
import * as moment from 'moment';
constructor(fb: FormBuilder) {
moment.fn.toJSON = function () { return this.format(); }
}
Does anyone has an idea ?