Hi,
On 14 Nov 2016, at 08:56, Gerritjan Koekkoek
<gerritjan(a)cdlsworld.org> wrote:
Hi,
I think this might a velocity/java script or groovy question more as a xwiki question.
We want to record a age (Period of days/seconds since birth date).
What datatype would you recommend:
- String structured
- Numeric integer of Days or Seconds
I’d use a Number.
- Date/Time
We would like to be able to display the data as:
- Date notation
- Years, Months, Weeks
- Years, Months, Days
- Years, Months
Things to consider is that each month has different period lengths in days and that each
4 years we have different number of days in a year
Should/Can we do this server side (velocity)
What velocity tools or services can we use
I’d use Joda Time ($xwiki.jodatime).
See
http://extensions.xwiki.org/xwiki/bin/view/Extension/Joda+Time+Plugin
You should google jodatime to find out all its API (it’s quite rich).
Thanks
-Vincent
Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website<http://www.cdlsworld.org>
Facebook<https://www.facebook.com/gerritjan.koekkoek>
email<gerritjan(a)cdlsworld.org>