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

Including 'ago' with fromNow returns weird strings like 'a month' #82

Open
burtonator opened this issue Nov 22, 2018 · 3 comments
Open

Comments

@burtonator
Copy link

When you include 'ago' with fromNow it includes an indefinite article ('a') before the time in some situations.

For "a month ago" it will generate "a month" which is really weird.

It should probably be more like "1 month"..

@burtonator
Copy link
Author

In fact it might be nice to have this as a property. I can see people wanting to just use "1 month ago" instead of "a month ago" or "1 minute ago" instead of "a minute ago"

@burtonator
Copy link
Author

This is a valid workaround:

filter={(value) => value.replace(/^a /g, '1 ')}

but probably only works for en-US locale

@bleonard252
Copy link

At least in English, "a/an" is a common way to denote one, i.e. "I have an apple," or "I sent you this a year ago!"

That being said, having an option to use digits/numbers to be more precise wouldn't hurt, although this might be out of scope for this package.

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

No branches or pull requests

2 participants