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.3k stars 411 forks source link

All languages needs to be registered #175

Closed Bramzor closed 5 years ago

Bramzor commented 5 years ago

Im trying to use timeago.js in Angular but have a hard time registering the locales because I cannot use require()

How can I register them all (or a selection) by using only import?

Bramzor commented 5 years ago

Found it, might be an idea to add it to the documentation import { nl as locale_NL } from 'timeago.js/lib/lang';

hustcc commented 5 years ago

Thanks, I will add the document in README.

if you want import all locales, maybe you can:

import 'timeago.js/dist/timeago.locales.min.js'

Bramzor commented 5 years ago

Great library btw! I like the fact that it is small instead of having to import libraries that are a few MB just for the timeago feature. Thanks a lot!

hustcc commented 5 years ago

😄