I've wasted so many dreary hours trying to figure out crappy time processing APIs and libraries. Never again!
I've wasted so many dreary hours trying to figure out crappy time processing APIs and libraries. Never again!
It does remove a lot of the ambiguity of "I wonder what this stdlib's quirks are in their date calculations" but it also seems like a non-trivial amount of effort to port every time.
Try not to have to do this sort of thing. You might have to though, and then you'll have to figure out what adding months means for your app.
However you also run into day to day business issues like:
* What if it's now a Holiday and things are closed?
* What if it's some commonly busy time like winter break? (Not quite a single holiday)
* What if a disaster of somekind (even just a burst waterpipe) halts operations in an unplanned way?
Usually flexability needs to be built in. It can be fine to 'target' +3 months, but specify it as something like +3m(-0d:+2w) (so, add '3 months' ignoring the day of month, clamp dom to a valid value, allow 0 days before or 14 days after),
72 business hours sounds more like human time than computer time anyways.