Open timbowhite opened 6 years ago
Thanks for logging this issue.
Definitely something that should get fixed. Hopefully I can make some time for this project again this summer.
great point @timbowhite here is the fix i think;
change line 891 from
890 // Cache moment's locale data.
891 var localeData = moment.localeData();
to
890 // Cache moment's locale data.
891 var localeData = this.localeData();
moment.duration(3973274078).locale('es').format();
// 1 mes, 16 días
ole :)
moment.js has 2 ways to set the locale: globally (all moment instances will use the set locale) or locally (only the single moment object instance will use the set locale).
moment-duration-format only seems to work when the locale is set globally. Below is an example where moment-duration-format uses the global locale even when the locale has been changed locally:
moment: 2.22.1 moment-duration-format: 2.2.2