Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using TimeAgo pipe for the http response date in string #157

Open
WilsonLau0755 opened this issue Sep 17, 2019 · 1 comment
Open

using TimeAgo pipe for the http response date in string #157

WilsonLau0755 opened this issue Sep 17, 2019 · 1 comment

Comments

@WilsonLau0755
Copy link

I am using ngx-pipes v2.5.6 for my angular8 project.

compare timeAgo pipe and date pipe in angular:
When i suscribe the date from server to UI. I pass the date (in Json) to timeAgo pipe, it will output a invalid time. So, i should transform all date in Json to date type first.
However, the date pipe in angular , it still works if i pass the date in Json.

So , Is it possible to judge the value type which pass in pipe first?
If it is a string and can be tranform into date type by new Date(), transform first and output it.
If it is in Date, output it directly.

@danrevah
Copy link
Owner

Please add a code example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants