hustcc / timeago.js

:clock8: :hourglass: timeago.js is a tiny(2.0 kb) library used to format date with `*** time ago` statement.
https://timeago.org
MIT License
5.29k stars 411 forks source link

fix: switch toString w/ toLocaleString to be able to format numbers in formatDiff #269

Open moaali opened 5 months ago

moaali commented 5 months ago

This PR fixes the issue of displaying numbers in english all the time regardless of the selected locale by adding numberLocale option

Issue was: منذ 3 دقائق showing english number in arabic

With this PR you can do this:

render(node, 'ar', { numberLocale: 'ar-u-nu-arab' })

and it takes the correct form: منذ ٣ دقائق

cr-gpt[bot] commented 5 months ago

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information