captbaritone / captbaritone/datejs
Feature request: Date difference
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
```
A frequent need for me is to display a human-readable difference between
two dates - for example how long until Christmas?
It's easy enough to do this in days and seconds, or even weeks etc, but I'd
really like to see "3 months, 20 days" or (in terms of times, not just
dates) "3 months, 19 days, 3 hours, 7 minutes". Getting the month
calculations right is hard (not undefined, as far as I know, but certainly
complex) and it would be nice to have a library routine to use, rather than
have to reinvent the logic myself each time.
The output should probably be an object, with "years", "months", "days",
etc attributes, which can be formatted manually, rather than a preformatted
string.
```
Original issue reported on code.google.com by `p.f.mo...@gmail.com` on 5 Sep 2009 at 7:55
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.