AndrewPoyntz / time-ago-pipe

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

Feature request: support future times #23

Open isaackwan opened 6 years ago

isaackwan commented 6 years ago

Currently it shows the diff in "xxx ago" which can be confusing at times.

Cheers :)

binarypatrick commented 6 years ago

Have you tried {{ (someDate | timeago).replace(' ago', '') }}

seiyria commented 6 years ago

@BinaryPatrick that works, but having it built in would be nicer. I wanted to make a pipe that wraps this pipe, but ran into injector errors (not sure why), so just having this built in would alleviate that sort of issue as well.

The other issue is that going in reverse will not work correctly with the timer that is set. It assumes that timestamps only move in the forward direction.

binarypatrick commented 6 years ago

I completely agree. Maybe it would be better to create a timeUntil pipe that mirrors timeAgo in the other direction.

seiyria commented 6 years ago

I ended up using https://www.npmjs.com/package/ngx-timeago which handles both cases with one pipe (which is ideal).