Comments (18)
@cvett try this:
import * as moment from 'moment';
import 'moment/min/locales';
moment.locale('fr-fr');
from ngx-moment.
@Yimiprod try
import * as moment from 'moment';
import * as locales from 'moment/min/locales';
moment.locale('fr-fr');
from ngx-moment.
Work!!
I did this:
import * as locales from 'moment/min/locales';
Thank you!
from ngx-moment.
@olavocneto it say cannot find module moment/min/locales
even if the the path to this module exist.
Edit: After some research, it look like moment have a typescript
file, who mess a little with the specs.
By the way, your doc ask us to do typings install --save moment
who's not working anymore.
from ngx-moment.
I am using Ionic2 and have not been able to make it work, does anybody know how to change locales in a Ionic2 app?
from ngx-moment.
Did you try all lower-case? see #20
moment.locale('pt-br');
from ngx-moment.
Yes, I try and still don't translate.
from ngx-moment.
You may also need to load moment locales. See the following plunker for a working example:
http://plnkr.co/edit/Psu31oOcDf3RaHJIEwv5?p=preview
from ngx-moment.
thanks for sharing your solution :)
from ngx-moment.
Same problem as @WilldelaVega777 on an ionic 2 project.
import * as moment from 'moment';
moment.locale('fr-fr');
Does nothing
from ngx-moment.
Didn't worked here too...
from ngx-moment.
Same bug here : cannot find module moment/min/locales :(
from ngx-moment.
For ionic2 i had to create a fix in my app
app.ts
import './patch/moment';
patch/moment.ts
moment.locale('fr', { /* copy paste the local definition from the library */ } as any);
from ngx-moment.
just load moment with locales only and it's working:
instead of: "{{PATH}}/moment/moment.js"
load: "{{PATH}}/moment/min/moment-with-locales.min.js"
from ngx-moment.
I have the Same Problem "cannot find module moment/min/locales" The solution not work.
from ngx-moment.
@LekisS Thanks its Works!
from ngx-moment.
@LekisS it works, thanks a lot.
from ngx-moment.
i've tried all these solutions in Ionic2 RC0, but it seems that it doesn't work.
I'm getting:
Error in ./TimeAgo class TimeAgo - inline template:0:6 caused by: Cannot read property 'humanize' of undefined
ORIGINAL EXCEPTION: Cannot read property 'humanize' of undefined
is there something else to do?
thanks
from ngx-moment.
Related Issues (20)
- amDateFormat does not refresh and and the browser is frozen
- Tslib missing from package.json file HOT 3
- amDuration set Humanize optionnal or create new pipe
- Check value emptiness in LocalTimePipe HOT 1
- Angular 8/9 HOT 1
- [docs] improve docs, how to import to core module HOT 1
- Support ng-add schematics HOT 1
- Setting relativeTimeThresholdOptions object doesn't work HOT 3
- Pipe could not be found with Angular 9 (Ivy enabled by default) HOT 7
- Problems with moment 2.25.0 HOT 16
- Getting warnings and errors related to moment and ngx-moment during compilation (ng serve) along with broken-page for timeago pipe HOT 1
- can't use amLocale with amLocal HOT 2
- ERROR Error: AddPipe: missing required arguments while using amAdd HOT 1
- ModuleWithProviders usage without type parameter no longer supported in angular 10. HOT 2
- Moment start with wrong time
- momentConstructor$a is not a function HOT 1
- i get warnings about pipes not being found despite importing everything HOT 2
- Errors since update to latest version (6.0.0) HOT 22
- Angular 13 + ngx-moment 6.0.2: This module is declared with using 'export = HOT 9
- amDateFormat - momentConstructor$9 is not a function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-moment.