Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for importing languages #252

Open
tacman opened this issue Mar 13, 2022 · 1 comment
Open

Documentation for importing languages #252

tacman opened this issue Mar 13, 2022 · 1 comment

Comments

@tacman
Copy link

tacman commented Mar 13, 2022

I'm trying to render in Spanish, and am not sure how to configure timeago.

import { register, format, render, cancel } from 'timeago.js';
import {esLocal} from 'timeago.js/lib/lang/es';
register('es', esLocal);

                    const nodes = document.querySelectorAll('.timeago');
                    // use render method to render nodes in real time
                    render(nodes, 'es');

I imagine I'm not registering it correctly, but I can't find the documentation on how to do that. Thanks.

@ernestwisniewski
Copy link

ernestwisniewski commented Apr 17, 2023

import es from 'timeago.js/lib/lang/es';
register('es', es);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants