Re: Advice on datetime manipulation
Re: Advice on datetime manipulation
- Subject: Re: Advice on datetime manipulation
- From: Dev WO <email@hidden>
- Date: Mon, 24 Oct 2005 20:38:58 +0200
This is a good advice Jean-François, I'll keep that in mind.
Thanks.
Concerning date/time library ...
I started using a real date library for date manipulation on a wo/
eof project, namely joda-time ( http://joda-time.sf.net )
everything was relatively fine until I had to do the UI (web
pages). The library gave me no formatter, and that was a big
surprise for me.
Since I had a nice wocomponent for date entry, using a calendar
(jscalendar - http://www.dynarch.com/projects/calendar ), at that
point I didn't see myself rewriting date formatter, and adjusting
my component just to handle my new date object.
I ended up reverting my eomodel's prototype to use NSTimestamp
instead. I had little modification, to do, but far less than
rewriting my utilities component to handle joda-time date objects.
So if you are thinking of not using NSTimestamp, I would recomment
to _NOT_ use joda-time as it prooved too difficult to integrate in
my wo workflow.
When I choosed joda-time over jodd, I thought that joda-time was
more complete. But I now realize that joda-time is just more
'complicated' and too big (bloated for my needs) and might prefet a
lighter library and give jodd a try eventually.
Sooner or later, NSTimestamp will eventually show his weakness again.
- jfv
Le 05-10-24, à 14:10, Dev WO a écrit :
Thanks Marc, I'm actually looking at it...
For what it's worth, I've found the Jodd JDateTime class much
easier and much more useful than the (horrendous) Java date
classes. Check it out http://jodd.sourceforge.net/
Marc
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/
_______________________________________________
WebObjects-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
http://www.freeiPods.com/?r=21419063
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden