egoist / vue-timeago

A timeago component for Vue.
https://vue-timeago.egoist.sh
MIT License
729 stars 104 forks source link

Proposal Fixing #55 - future dates #66

Closed benyanke closed 6 years ago

benyanke commented 6 years ago

far from done, but a first step showing an example of what future date handling could look like.

Looking for thoughts to see if I should continue.

Tag #55

rijkvanzanten commented 6 years ago

Hey @benyanke! What else needs to be done to consider this ready for action? I would love to have this functionality available in the plugin πŸ˜„

egoist commented 6 years ago

Maybe we could integrate https://date-fns.org/v1.29.0/docs/distanceInWordsToNow to save a lot of works πŸ˜„

rijkvanzanten commented 6 years ago

Great idea @egoist πŸ˜„

Do you also plan on replacing the β€œregular” date ago with date-fns’ distanceInWords?

egoist commented 6 years ago

@rijkvanzanten yeah sure

rijkvanzanten commented 6 years ago

There is one slight problem with the date-fns implementation of distanceInWordsToNow: it doesn't use the actual word ago in the output. E.g. 2 days ago in vue-timeago is rendered as 2 days when using distanceInWordsToNow.

egoist commented 6 years ago

@rijkvanzanten there's an option for that in distanceInWordsToNow

btw this landed in v4 πŸ˜„

rijkvanzanten commented 6 years ago

Oh nice! Didn't see that in the docs πŸ™‚

Thanks for your awesome OSS work @egoist! ❀️

benyanke commented 6 years ago

Looks like this is resolved, but is there anything else needing to be done to use it, or will it automatically use before/after when specifying :since?

rijkvanzanten commented 6 years ago

@benyanke Automatically based on :since πŸ™‚ (Just tried this in my app + it's in the example)

benyanke commented 6 years ago

Awesome - I must be hitting another bug then.