|
From: Luigi B. <lui...@gm...> - 2009-09-01 16:33:11
|
On Tue, 2009-09-01 at 17:58 +0200, Ferdinando Ametrano wrote: > On Tue, Sep 1, 2009 at 3:45 PM, Dima<dim...@go...> wrote: > > Wouldn't it make sense to add [to isEndOfMonth]: > > if(!isBusinessDay(d)) return false > > no, it doesn't, at least not in general. Hmm. Pity I didn't get this mail before committing... > E.g. bond maturity date being on a non-business end-of-month day, you > might want all other dates to be end-of-month But then, _in the schedule constructor_, you would check the maturity with Date::isEndOfMonth, or adjust the maturity with Preceding and check that for end-of-month. The meaning of Calendar::isEndOfMonth shouldn't depend on the use we want to do of the date, and according to the docs is "is this the last business day of the month?". If we decide that the meaning of ifEndOfMonth is "are there any business days after this?" (which is a different thing) then the implementation is ok. But in that case we have to change the documentation. Thoughts? Luigi -- There is no likelihood man can ever tap the power of the atom. -- Robert Millikan, Nobel Prize in Physics, 1923 |