[squeak-dev] Chronology and birthdays/ages

Ken Causey klcausey at gmail.com
Fri Jun 25 21:42:25 UTC 2021


This is the best I have managed, at least as a single line

Date current year - (Date year: 1971 month: 1 day: 5) year - ((Date year:
1971 month: 1 day: 5) dayOfYear < Date current dayOfYear ifTrue: 0 ifFalse:
1)

This also works in Cuis.  Use of a variable for the birth date helps to
reduce repetition of course.

Ken

On Fri, Jun 25, 2021 at 2:30 PM tim Rowledge <tim at rowledge.org> wrote:

> I was just looking at calculating an age from birth date and 'test' date
> and was startled to find no convenient method in the relevant classes.
> Given how many things Chronology does I'm convinced I must have missed
> sometihng obvious - but where?
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: LD: Lose Device
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210625/52ca0412/attachment-0001.html>


More information about the Squeak-dev mailing list