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 for passing in a number to the pipe #29

Open eranation opened 5 years ago

eranation commented 5 years ago

Some IDEAs (latest Intellij) will complain when passing a number to the pipe (since its transform method accepts only a string)

Date's constructor does support passing a number, so in runtime this works. It also passes compilation by the angular template compiler, the only issue is IDEA warning and future risk angular template compiler may fail the compilation based on type checking

Suggested fix in pull request: https://github.com/AndrewPoyntz/time-ago-pipe/pull/28