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.
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.