Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make prefix/suffix be included conditionally instead of always. #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rpocklin
Copy link

Motivation
My use case is in a real-time app with expiring offers, but after ending I want to show the end time as '1 minute ago' or 'in less than 1 minute' when end time is in the future. The current codebase was always including the prefix and suffix which didn't make sense 'in less than 1 minute ago' :P This PR fixes this behaviour.

Looking at the repo history the code was once more conditional and this was changed to always include it, not sure why?

I've been able to simplify the tests, and added 2 more at the bottom to prove the formatting of the resulting text is correct.

…ead of always.

Added specs and simplified existing tests.

Includes generated js from coffeescript 1.6.3.
@rpocklin
Copy link
Author

Any chance to review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant