Closed rausnitz closed 8 years ago
@rausnitz Would you consider using the serial comma in your addition? It would provide a consistency in separation of units as well as being consistent with how JavaScript uses lists (arrays), without sacrificing the increased natural language it affords.
Instead of "the conjunction rather than the final delimiter", "inserting the conjunction between the final delimiter and final value when there are three or more values": 3 days and 14 minutes
or 3 hours, 1 minute, and 14 seconds
I understand that people opine strongly about style, so I'm not offended in the slightest if you don't agree with me, but I just want to throw the idea out there for consideration.
I agree about the serial comma. Perhaps there's a way to make it configurable?
I like serial commas too. I'll have an update in shortly.
It now prepends a serial comma to the conjunction if there are more than two values. People can opt out by using the serialComma: false
option.
I merged this into a new conjunctions
branch. I'm a bit busy and don't want to rush a release out, but this looks good and should be ready soon.
Thanks!
This is released in Humanize Duration 3.8.0! Thanks for your contribution.
This adds an option for using a conjunction rather than the final delimiter. For example, the output could be
3 days and 14 minutes
or3 hours, 1 minute & 14 seconds
.