Hi Ken:)
You're asking why? because it's too simple:) :)
This is a really good point and it simplify everything.

Thanks Ken

Xavier



Why not just get the current year and subtract the year of birth?

On Oct 24, 2005, at 1:37 PM, Dev WO wrote:


Thanks Sacha,
you are right, "age" is calculated based on "the first new year following the date of birth". I'll dig into the datetime methods to see if there's already something I could use...





On Oct 24, 2005, at 10:24 AM, Dev WO wrote:




Hi list,
usually I do something stupid and then ask for your help;) so this time I though it would be wise to ask before doing something "not good":) So I have to handle poneys and horses (yes it's funny), and they have something very specific:
These "items" aren't 1 year old when they have 12 month!
In fact they get 1 year old when they cross their first "new year", so if it has born on december 29th it will be 1 year old only 3 days after...

And I have to manage "categories" depending of their "age".

So my question is regarding the clever way to handle that.

I've got their date of birth in database. I don't think I can handle something like their "official age" directly in the EOModel (but I may be wrong), so I think I have to handle that directly in code.

Quite some items are already in the database, but maybe it would be good to handle this when they insert the item like having another attribute "official date of birth" which will be set to the previous new year and so doing the "regular" calculation on this attribute and not on the "real" date of birth.

Or handling all this when generating the list only.

Any advice on this is greatly appreciated, or pointer to specific method that would be of help:)




Sounds like the "age" is a calculated field, based on date of birth. Your best bet is probably to create a method "age" on your EO that returns the age, calculated from the date of birth.

HTH,


sacha

--
Sacha Michel Mallais             Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65             AIM: smallais
Bottom posting is your friend:
http://www.river.com/users/share/etiquette/








_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/lists% 40anderhome.com

This email sent to [EMAIL PROTECTED]






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to