Giter Site home page Giter Site logo

Translating the pipe output about ngx-moment HOT 8 CLOSED

urish avatar urish commented on July 22, 2024
Translating the pipe output

from ngx-moment.

Comments (8)

urish avatar urish commented on July 22, 2024 1

You can try to import "moment/locale/fr" after importing moment and see if this does the trick.
Anyway, it sounds weird that you are not able to call moment() despite being able to call moment.locale('fr') - I suggest that you post a question on StackOverflow about that.

from ngx-moment.

urish avatar urish commented on July 22, 2024

Yes, though moment's locale support:

https://github.com/moment/momentjs.com/blob/master/docs/moment/06-i18n/01-changing-locale.md

from ngx-moment.

theunreal avatar theunreal commented on July 22, 2024

@urish Are you sure this documentation works with this module?
I've been trying to use moment.locale('fr'); after importing import * as moment from 'moment'; but the language locale is still English.

Also tried to log console.log(moment(1316116057189).fromNow());
and got Error: TypeError: moment is not a function

from ngx-moment.

urish avatar urish commented on July 22, 2024

You may also need to loaded locale files, as explained here:
http://momentjs.com/docs/#/i18n/loading-into-browser/

Do you get English or French output when you call moment().fromNow()?

from ngx-moment.

theunreal avatar theunreal commented on July 22, 2024

thanks @urish, I didn't load the locale file - but I have no idea how to load it after moment is loaded, since I'm using SystemJS.
When I output moment().fromNow() I get Error: TypeError: moment is not a function as described in my last post

from ngx-moment.

theunreal avatar theunreal commented on July 22, 2024

The import you suggested worked, Thanks!

from ngx-moment.

urish avatar urish commented on July 22, 2024

👍

from ngx-moment.

qingfx avatar qingfx commented on July 22, 2024

Kudos on import "moment/locale/fr"

I was just struggling to figure out how to import a JS file into TS source

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.