[etoys-dev] Etoys: Kernel-Richo.4.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Jun 29 13:31:00 EDT 2010
Ricardo Moran uploaded a new version of Kernel to project Etoys:
http://source.squeak.org/etoys/Kernel-Richo.4.mcz
==================== Summary ====================
Name: Kernel-Richo.4
Author: Richo
Time: 29 June 2010, 2:30:06 pm
UUID: 6a67d201-be46-6641-8d2c-6f8692b09c3d
Ancestors: Kernel-bf.3
* Fixed Date>>#addMonths: (from Squeak)
=============== Diff against Kernel-bf.3 ===============
Item was changed:
----- Method: Date>>addMonths: (in category 'utils') -----
addMonths: monthCount
+ |year month maxDaysInMonth day |
+ year := self year + (monthCount + self monthIndex - 1 // 12).
+ month := self monthIndex + monthCount - 1 \\ 12 + 1.
+ maxDaysInMonth := Month daysInMonth: month forYear: year.
+ day := self dayOfMonth > maxDaysInMonth
+ ifTrue: [maxDaysInMonth]
+ ifFalse: [self dayOfMonth].
^ Date
+ newDay: day
+ month: month
+ year: year!
- newDay: self dayOfMonth
- month: self month + monthCount - 1 \\ 12 + 1
- year: self year + (monthCount + self month - 1 // 12)!
More information about the etoys-dev
mailing list