react-moment
react-moment copied to clipboard
Including 'ago' with fromNow returns weird strings like 'a month'
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"..
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"
This is a valid workaround:
filter={(value) => value.replace(/^a /g, '1 ')}
but probably only works for en-US locale
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.