On 12/2/14 2:14 PM, Steven Schveighoffer wrote:

Not an oversight.

Date.add and Date.roll are for adding units that are variable.

For example, how many days are in a month? Answer: depends on the month.
How many days in a year? Answer: depends on the year.

But days are NOT variable, there are exactly 24 hours in a day. So to
add a day, you just add a day with +=.

Aaaand to expand on this, since roll *does* support days, it's because the number being added isn't the important unit, it's the unit above. Hence rolling days means you will stay in the same month.

I'm not exactly sure of the reason behind roll, but I'm sure Jonathan has one :)

-Steve

Reply via email to