Struggling to develop an Angular pipe that accurately converts milliseconds to hh:mm:ss format. Despite researching several articles, none of the solutions seem to work.
Here is a snippet of the current pipe.ts implementation:
transform(value)
{
let formatted;
let duration = moment.duration(value, "milliseconds");
if (value < 59999){
formatted = `00:00:${duration.format("hh:mm:ss")}`;
}
else if (value < 3599999){
formatted = `00:${duration.format("hh:mm:ss")}`;
}
else {
formatted = duration.format("hh:mm:ss");
}
return formatted;
However, there seems to be an error in the code. For example, when passing 23677258 milliseconds, the output obtained is 3:44:20 instead of the expected result.