f3l1x
← Wiki

JavaScript / Typescript

Last updated

Resources

NPM

Vue

Nuxt.js

Datagrid

React

Library

dayjs

return dayjs.duration(time, unit)
    .format('Y [years] M [months] D [days] H [hours] m [minutes] s [seconds]')
    .replace(/\b0 years\b/, '')
    .replace(/\b0 months\b/, '')
    .replace(/\b0 days\b/, '')
    .replace(/\b0 hours\b/, '')
    .replace(/\b0 minutes\b/, '')
    .replace(/\b0 seconds\b/, '')
    .trim();

Typescript

esc

Type to search. ↑ ↓ to move, ↵ to open.