Giter Site home page Giter Site logo

Internationalization support? about ngx-moment HOT 7 CLOSED

urish avatar urish commented on July 22, 2024
Internationalization support?

from ngx-moment.

Comments (7)

urish avatar urish commented on July 22, 2024

You can directly use moment.locale(). The amTimeAgo implantation uses moment.js methods, so it should respect the configured locale.

from ngx-moment.

stan-ros avatar stan-ros commented on July 22, 2024

thx

from ngx-moment.

heitorfig avatar heitorfig commented on July 22, 2024

Maybe I'm doing something wrong. But for me, using moment.locale() isn't working. This happens: "ReferenceError: moment is not defined". Am I missing something? By the way, I'm actually usign it in Ionic 2 Framework.

My header looks like this:

import {Http, HTTP_PROVIDERS} from 'angular2/http';
import {Page, Geolocation, NavParams} from 'ionic/ionic';
import {TimeAgoPipe} from 'angular2-moment';

from ngx-moment.

urish avatar urish commented on July 22, 2024

Try adding:

import * as moment from 'moment';

to the list of your import statements. You may also need to install moment via npm by running npm i -S moment

from ngx-moment.

heitorfig avatar heitorfig commented on July 22, 2024

Thank you urish!
It worked!

from ngx-moment.

victorcarvalhosp avatar victorcarvalhosp commented on July 22, 2024

Someone can give one example of moment.locale() usage?

from ngx-moment.

stan-ros avatar stan-ros commented on July 22, 2024

https://github.com/flaper/web/blob/master/src/main.ts#L64

from ngx-moment.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.