LP#1635737 Due date calculation honors variable durations user/berick/lp1635737-due-date-interval-smarts
authorBill Erickson <berickxx@gmail.com>
Wed, 22 Mar 2017 19:02:58 +0000 (15:02 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 22 Mar 2017 19:03:08 +0000 (15:03 -0400)
commit186d55f56a92afddd4dc7289d6c1fbe1d7eafc8b
tree607782444d5188dc236bacf486d00f719a2fffb2
parent2cbabc4faafd364145a9d75980e87629df0708e9
LP#1635737 Due date calculation honors variable durations

Due date calculations now take time changes, variable length months, and
variable length (leap) years into account.

For example, a duration of "1 month" results in a due date with the same
day the following month, instead of simply adding 365/12=~30 days to
today.

Note, in cases where a matching day in the following month (or year)
does not exist (e.g. Jan 31 + "1 month"), days are added to the result
to accommodate the extra days.  Jan 31 + "1 month" yields March 3rd in
a non-leap year.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm