urish / ngx-moment

moment.js pipes for Angular
MIT License
1.18k stars 154 forks source link

can't use amLocale with amLocal #238

Closed ahmedkhairydev closed 3 years ago

ahmedkhairydev commented 4 years ago

Description of the Issue and Steps to Reproduce:

Did you search for duplicate issue? [Yes / No] Yes.

I can't use amLocale with amLocal. amLocal doesn't work correctly. amLocal working correctly when using it without amLocale. when using amLocal the time becomes to be in Arabic character

<span class="time">{{ row.dateModified | amLocale: 'en' | amFromUtc | amLocal | amDateFormat: 'hh:mm a' }}</span>

Preview image

Version

"moment": "^2.24.0",
"ngx-moment": "^3.5.0",
"moment-hijri": "^2.1.2"

Environment:

sergey-morenets commented 3 years ago

Hi @ahmedkhairydev

Just tested with ngx-moment 5.0. Locale was chosen correctly.

ahmedkhairydev commented 3 years ago

Hi @sergey-morenets

Thanks for your support The issue is resolved but the sequence of the pipes should be correct! 😂

Right Way

<span class="time"> {{ row.dateModified | amFromUtc | amLocal | amLocale: 'en' | amDateFormat: 'hh:mm a'  }} </span>

Wrong Way

<span class="time"> {{ row.dateModified  | amLocale: 'en' | amFromUtc | amLocal | amDateFormat: 'hh:mm a'  }} </span>