G
Gene Wirchenko
Dear JavaScripters:
I have just about finished my date class. One of the last
consequential functions is to add/subtract days from a date.
In IE9, with Date, one can do
SomeDate.setDate(SomeDate.getDate()+n);
and if there is overflow in the days of the month, the date will be
normalised. e.g. 2011-12-31 + 32 = 2012-02-01.
Is this behaviour that I can count on? It seems to fail at 366
days. I have seen nothing documenting the normalising, but the
standard says very little about Date's setDate().
Sincerely,
Gene Wirchenko
I have just about finished my date class. One of the last
consequential functions is to add/subtract days from a date.
In IE9, with Date, one can do
SomeDate.setDate(SomeDate.getDate()+n);
and if there is overflow in the days of the month, the date will be
normalised. e.g. 2011-12-31 + 32 = 2012-02-01.
Is this behaviour that I can count on? It seems to fail at 366
days. I have seen nothing documenting the normalising, but the
standard says very little about Date's setDate().
Sincerely,
Gene Wirchenko