I am using moment.js in my TypeScript (Ionic2/Angular2) project. Following on from this post, I now want to try out a plugin moment-duration-format
I have the npm packag
I was using the workaround here, but it now looks like the ype def has been fixed. Getting an update of the type def So I can do the following...
import * as moment from 'moment';
import 'moment-duration-format';
let duration = moment.duration(decimalHours, 'hours') ;
let options : moment.DurationFormatSettings = {
forceLength : false,
precision : 0,
template : formatString,
trim : false
};
let result = duration.format(formatString, 0, options);