Dayjs: Any workaround for format duration in h m

Discussão em 'Angular' iniciado por Vaibhav D, Junho 22, 2025.

  1. Vaibhav D

    Vaibhav D Guest

    I am using dayjs library's duration object for duration format.

    dayjs.duration(1500, 'minutes').format('H[h] m[m]') // returns 1h 0m


    Seems the library converts the 24hrs to 1 day and puts the remaining 1 hour in hours. Actually, I want the output as 25h 0m.

    Is there any way we can achieve this with days.js or any minimal custom logic along with the use of duration object?? Or any other library provides this functionality itself??

    Continue reading...

Compartilhe esta Página