AndrewPoyntz / time-ago-pipe

An Angular pipe for converting a date string into a time ago
MIT License
130 stars 67 forks source link

question: how to use this pipe in a different languages? #30

Closed akildemir closed 5 years ago

akildemir commented 5 years ago

Is there a way this pipe display the time or in a local language?

marcio199226 commented 5 years ago

instead of returning "a few seconds ago" return an placeholder and translate it by ngx-translate/core pipe or service directly, of course you have to fork this repo

akildemir commented 5 years ago

@marcio199226 Thanks. I changed the code in the local without forking and returned a placeholder that match my translation files and then chain the this pipe with translate like so : {{ post.created_at | timeAgo | translate}} but it did not take any affect. I tried the log something from the source code of the pipe to check if the code I changed is getting executed but no I wasn't. Does npm prevent the changes the source code of plugins somehow? Do I really need to fork this repo and install the forked version?

akildemir commented 5 years ago

Actually I now realized that I was editing wrong version of the source code. There was 2 of them. Anyways thanks @marcio199226 this was really helpful.