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

moment in others languages #20

Closed
victorcarvalhosp opened this issue Mar 15, 2016 · 2 comments
Closed

moment in others languages #20

victorcarvalhosp opened this issue Mar 15, 2016 · 2 comments

Comments

@victorcarvalhosp
Copy link

It's possible to use moment in portuguese, for example? How I can do that? Thanks!

@urish
Copy link
Owner

urish commented Mar 15, 2016

Perhaps this will help:

First, import the moment module:

import * as moment from 'moment';

Then, inside your code, you can switch the locale, e.g.:

moment.lang('pt-br');

You can find the full list of moment locales here: https://github.com/moment/moment/tree/develop/locale

@numerized
Copy link

numerized commented Jul 27, 2016

solution here

alex-pl commented 5 hours ago
I could solve the locale problem for an Angular 2 project (ES6) as well as for an Ionic 2 app.

Import a single locale:

import moment from 'moment';
import 'moment/locale/de';
Import all locales:

import moment from 'moment';
import 'moment/min/locales.min';
The locale import and setting of moment.locale('de'); is only required in the main component (eg. main.js, app.js).

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

3 participants