[IMP]Remove redundant logic of format_duration instead put it in utils.js file and use it