Closed joeveiga closed 2 years ago
Hi @joeveiga , I like the idea of `dfnsFormatRelativeToNow, and I'm pretty sure other users will benefit from this. I will be releasing a new version with the new pipe in the coming days. Cheers!
@joanllenas Thank you! 🙏
@joeveiga this is ready! https://github.com/joanllenas/ngx-date-fns/releases/tag/v8.2.0 Cheers!
Closing
Description of the Issue and Steps to Reproduce:
Hello 👋 ! I'd like to propose the addition of a new
dfnsFormatRelativeToNow
pipe which assumesnew Date()
as the second argument. Alternatively you could modifydfnsFormatRelative
pipe to behave that way here, but I understand perhaps you want to keep that pipe consistent with the original behavior indate-fns
(although having a default wouldn't be a breaking change, IMO).Motivation
For my usecase(s), and probably others as well, the most common scenario in which I use that pipe is I want to see the date relative to "now". The required pipe argument becomes an issue because then in every component I need to have a field to expose the current date, like so:
I'd much rather not have to create my own pipe just to add that default argument 😄 . Thanks!