I'm trying to add a function to the momentjs prototype. In Javascript, the code was like this:
Object.getPrototypeOf(moment()).isWeekend = function() {
return this.isoWeekday() >= 6;
};
How do I do this in typescript? I've read that i need to duplicate the interface and and my function to it, but that's not working:
module moment {
interface Moment {
isWeekend(): boolean
}
Moment.prototype.isWeekend = () => {
this.isoWeekday() >= 6;
};
}