Any idea why this doesn’t work or how I can extend the duration interface to support the format function?
declare module \'moment\' { interface Duration
First, install types:
npm install --save-dev @types/moment-duration-format
Second, import them in your file:
/// import * as moment from 'moment'; import 'moment-duration-format';
Then you can use
moment.duration(minutes, 'minutes').format('mm');