Dayjs: [Duration] Duration humanize requires RelativeTime plugin but not mentioned.

Created on 6 Aug 2020  路  2Comments  路  Source: iamkun/dayjs

I'm using Duration plugin for formatting a duration as the documentation guides, but got the following error:

Uncaught TypeError:  t(...).add(...).locale(...).fromNow is not a function

I realized that .humanize() from Duration plugin relies on .fromNow() method provided by RelativeTime plugin, which is not mentioned in documentation. I think either this should be stated in the docs, or Duration should just load RelativeTime automatically.

Most helpful comment

All 2 comments

We have mentioned it https://day.js.org/docs/en/durations/humanize.

But should add it to this as well, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fes300 picture fes300  路  5Comments

LauRocky picture LauRocky  路  5Comments

Sunrise1970 picture Sunrise1970  路  4Comments

dakshshah96 picture dakshshah96  路  5Comments

oliv9286 picture oliv9286  路  4Comments