Can anyone help me figure out why this code isn't working or provide guidance on how to enhance the duration interface to include support for the format function?
declare module 'moment' {
interface Duration {
format(template: string, precision?: string, settings?: any): string;
}
}
Example usage:
moment.duration(minutes, 'minutes').format('mm');
I'm encountering an error stating that 'format' is not recognized as a type within 'Duration'