[xwiki-users] jodatime challenge
Hi, I would like to calculate the age of a person in years I have the date of birth stored in a XWiki class-object in a property of type Date/Time The age should be calculated against NOW! (Sysdate in local-user time, although the rounding in years does not make this a very important requirement. Also I would like to be able to calculate a duration by subtracting two dates stored in a XWiki class-object in a property of type Date/Time Please a velocity-based guidance how to do this? (JoDaTime based) 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<[email protected]>
Have you checked the documentation for the DateTool <https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/generic/DateTool.html> and the ComparisonDateTool <https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/generic/ComparisonDateTool.html> ? -- View this message in context: http://xwiki.475771.n2.nabble.com/jodatime-challenge-tp7602468p7602489.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi! I've been these last days trying to regain access to an ancient issue while dealing with dates. Searching Jira I found this... http://jira.xwiki.org/browse/XWIKI-5610?jql=text%20~%20%22datetool%22 ... and this at XWiki Platforma site... http://platform.xwiki.org/xwiki/bin/view/SRD/datetool To the best of my understanding ComparisonDateTool is implemented and accessible through $datetool velocity variable. But I'm not able to get it working. On Thu, Jan 19, 2017 at 3:54 PM Hamster <[email protected]> wrote: Have you checked the documentation for the DateTool < https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
and the ComparisonDateTool < https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
? Please, check this page... http://atriumkm.idisantiago.es/bin/ICT/PureDate I'm able to get working the examples at DateTool page, but not those at ComparisonDateTool page. Please, could anybody point us in the right direction? Where are we failing? -- View this message in context: http://xwiki.475771.n2.nabble.com/jodatime-challenge-tp7602468p7602489.html Sent from the XWiki- Users mailing list archive at Nabble.com. Thank you very much for your work! Ricardo -- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
Hi! The same code works fine in an XWiki 7.3 installation... http://portal.idisantiago.es/xwiki/bin/view/ICT/PureDate/ Thus, "my" problem is to find where ComparisonDateTool is located in this installation and make it works in a legacy XWiki Enterprise 2.4.30451 one. Any help will be welcome! Thank! On Thu, Jan 19, 2017 at 11:41 PM [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! I've been these last days trying to regain access to an ancient issue while dealing with dates. Searching Jira I found this...
http://jira.xwiki.org/browse/XWIKI-5610?jql=text%20~%20%22datetool%22
... and this at XWiki Platforma site...
http://platform.xwiki.org/xwiki/bin/view/SRD/datetool
To the best of my understanding ComparisonDateTool is implemented and accessible through $datetool velocity variable. But I'm not able to get it working.
On Thu, Jan 19, 2017 at 3:54 PM Hamster <[email protected]> wrote:
Have you checked the documentation for the DateTool < https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
and the ComparisonDateTool < https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
?
Please, check this page...
http://atriumkm.idisantiago.es/bin/ICT/PureDate
I'm able to get working the examples at DateTool page, but not those at ComparisonDateTool page. Please, could anybody point us in the right direction? Where are we failing?
-- View this message in context: http://xwiki.475771.n2.nabble.com/jodatime-challenge-tp7602468p7602489.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Thank you very much for your work!
Ricardo -- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
Hi,
On 20 Jan 2017, at 08:27, [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! The same code works fine in an XWiki 7.3 installation...
http://portal.idisantiago.es/xwiki/bin/view/ICT/PureDate/
Thus, "my" problem is to find where ComparisonDateTool is located in this installation and make it works in a legacy XWiki Enterprise 2.4.30451 one.
Wow XE 2.4 is really old... I don’t remember if the $datetool binding was available and it’s possible that it wasn’t. FYI it’s located in a java class in the xwiki-velocity*.jar file. Thanks -Vincent
Any help will be welcome! Thank!
On Thu, Jan 19, 2017 at 11:41 PM [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! I've been these last days trying to regain access to an ancient issue while dealing with dates. Searching Jira I found this...
http://jira.xwiki.org/browse/XWIKI-5610?jql=text%20~%20%22datetool%22
... and this at XWiki Platforma site...
http://platform.xwiki.org/xwiki/bin/view/SRD/datetool
To the best of my understanding ComparisonDateTool is implemented and accessible through $datetool velocity variable. But I'm not able to get it working.
On Thu, Jan 19, 2017 at 3:54 PM Hamster <[email protected]> wrote:
Have you checked the documentation for the DateTool < https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
and the ComparisonDateTool < https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
?
Please, check this page...
http://atriumkm.idisantiago.es/bin/ICT/PureDate
I'm able to get working the examples at DateTool page, but not those at ComparisonDateTool page. Please, could anybody point us in the right direction? Where are we failing?
-- View this message in context: http://xwiki.475771.n2.nabble.com/jodatime-challenge-tp7602468p7602489.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Thank you very much for your work!
Ricardo -- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
Thanks Vincent! On Fri, Jan 20, 2017 at 9:06 AM Vincent Massol <[email protected]> wrote:
Hi,
On 20 Jan 2017, at 08:27, [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! The same code works fine in an XWiki 7.3 installation...
http://portal.idisantiago.es/xwiki/bin/view/ICT/PureDate/
Thus, "my" problem is to find where ComparisonDateTool is located in this installation and make it works in a legacy XWiki Enterprise 2.4.30451 one.
Wow XE 2.4 is really old...
I don’t remember if the $datetool binding was available and it’s possible that it wasn’t.
FYI it’s located in a java class in the xwiki-velocity*.jar file.
Yes, XE 2.4 is really a paleoXWiki installation! But it is still solving some problems to me here! That pending migration is still a pending migration/upgrade... Some notes on this issue in comments here... http://atriumkm.idisantiago.es/bin/ICT/PureDate I'll give it a try ASAP! Cheers!
Thanks -Vincent
Any help will be welcome! Thank!
On Thu, Jan 19, 2017 at 11:41 PM [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! I've been these last days trying to regain access to an ancient
issue
while dealing with dates. Searching Jira I found this...
http://jira.xwiki.org/browse/XWIKI-5610?jql=text%20~%20%22datetool%22
... and this at XWiki Platforma site...
http://platform.xwiki.org/xwiki/bin/view/SRD/datetool
To the best of my understanding ComparisonDateTool is implemented and accessible through $datetool velocity variable. But I'm not able to get it working.
On Thu, Jan 19, 2017 at 3:54 PM Hamster <[email protected]> wrote:
Have you checked the documentation for the DateTool <
https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
and the ComparisonDateTool <
https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
?
Please, check this page...
http://atriumkm.idisantiago.es/bin/ICT/PureDate
I'm able to get working the examples at DateTool page, but not those at ComparisonDateTool page. Please, could anybody point us in the right direction? Where are we failing?
-- View this message in context:
http://xwiki.475771.n2.nabble.com/jodatime-challenge-tp7602468p7602489.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
Thank you very much for your work!
Ricardo -- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
Reading the documentation of the XWiki JoDaTime module (XWiki services based) I feel it holds a lot of value next to $datetool and $datecomparisontool (velocity based) But I fail to understand the documentation http://extensions.xwiki.org/xwiki/bin/view/Extension/Joda+Time+Plugin As the examples are quite easy to read they did not clarify me enough to just use date-values stored in XWiki XObjectProperties of type date What default format does the property deliver; Should I use $doc.Display(date-property)? , $doc.Display(date-property).value() or $object.getProperty(date-property) What I understand from JoDaTime is that it is great to render dates in 'view' mode in the internationally localized format (Dutch Notation vs English Notation), but when I switch to 'edit' mode how can I have a DateWidget understands that format So my simple question was to calculate the age based on a date-property in a wiki object and Now? 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<[email protected]> ________________________________ From: users <[email protected]> on behalf of [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> Sent: 20 January 2017 09:36:05 To: XWiki Users Subject: Re: [xwiki-users] jodatime challenge Thanks Vincent! On Fri, Jan 20, 2017 at 9:06 AM Vincent Massol <[email protected]> wrote:
Hi,
On 20 Jan 2017, at 08:27, [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! The same code works fine in an XWiki 7.3 installation...
http://portal.idisantiago.es/xwiki/bin/view/ICT/PureDate/
Thus, "my" problem is to find where ComparisonDateTool is located in this installation and make it works in a legacy XWiki Enterprise 2.4.30451 one.
Wow XE 2.4 is really old...
I don’t remember if the $datetool binding was available and it’s possible that it wasn’t.
FYI it’s located in a java class in the xwiki-velocity*.jar file.
Yes, XE 2.4 is really a paleoXWiki installation! But it is still solving some problems to me here! That pending migration is still a pending migration/upgrade... Some notes on this issue in comments here... http://atriumkm.idisantiago.es/bin/ICT/PureDate I'll give it a try ASAP! Cheers!
Thanks -Vincent
Any help will be welcome! Thank!
On Thu, Jan 19, 2017 at 11:41 PM [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! I've been these last days trying to regain access to an ancient
issue
while dealing with dates. Searching Jira I found this...
http://jira.xwiki.org/browse/XWIKI-5610?jql=text%20~%20%22datetool%22
... and this at XWiki Platforma site...
http://platform.xwiki.org/xwiki/bin/view/SRD/datetool
To the best of my understanding ComparisonDateTool is implemented and accessible through $datetool velocity variable. But I'm not able to get it working.
On Thu, Jan 19, 2017 at 3:54 PM Hamster <[email protected]> wrote:
Have you checked the documentation for the DateTool <
https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
and the ComparisonDateTool <
https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
?
Please, check this page...
http://atriumkm.idisantiago.es/bin/ICT/PureDate
I'm able to get working the examples at DateTool page, but not those at ComparisonDateTool page. Please, could anybody point us in the right direction? Where are we failing?
-- View this message in context:
http://xwiki.475771.n2.nabble.com/jodatime-challenge-tp7602468p7602489.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
Thank you very much for your work!
Ricardo -- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
Hi Gerritjan! Please, allow me to follow this thread to initiate my understanding about how to deal with date within XWiki! It seems to me that, at least, I'm missing some basic concept! On Fri, Jan 20, 2017 at 10:44 AM Gerritjan Koekkoek <[email protected]> wrote:
Reading the documentation of the XWiki JoDaTime module (XWiki services based) I feel it holds a lot of value next to $datetool and $datecomparisontool (velocity based)
But I fail to understand the documentation
http://extensions.xwiki.org/xwiki/bin/view/Extension/Joda+Time+Plugin
As the examples are quite easy to read they did not clarify me enough to just use date-values stored in XWiki XObjectProperties of type date
What default format does the property deliver; Should I use $doc.Display(date-property)? , $doc.Display(date-property).value() or $object.getProperty(date-property)
I've also added a date property to XWikiUsers class, populated it for a bunch of users by editing objects and using the format described at creation time and I'm not able to read it. $doc.Display(date-property) reads something which is shown as an empty string, thus, nothing is shown, and the the other two string area shown as is, thus they are interpreted as text strings and are reading nothing from any object property!
What I understand from JoDaTime is that it is great to render dates in 'view' mode in the internationally localized format (Dutch Notation vs English Notation), but when I switch to 'edit' mode how can I have a DateWidget understands that format
So my simple question was to calculate the age based on a date-property in a wiki object and Now?
I've played a bit with those JoDaTime example and do this... http://portal.idisantiago.es/xwiki/bin/viewrev/ICT/PureTime/WebHome?rev=14.1 And I'm not happy with this as I'm still 51 years old! My birthday will be next Sunday and my XWiki installation is set to System Default Timezone. Please, anybody could explain me why XWiki is telling me that I'm already 52 year old? :-( Please, what am I missing? Thank you so much!
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<[email protected]>
________________________________ From: users <[email protected]> on behalf of [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> Sent: 20 January 2017 09:36:05 To: XWiki Users Subject: Re: [xwiki-users] jodatime challenge
Thanks Vincent!
On Fri, Jan 20, 2017 at 9:06 AM Vincent Massol <[email protected]> wrote:
Hi,
On 20 Jan 2017, at 08:27, [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! The same code works fine in an XWiki 7.3 installation...
http://portal.idisantiago.es/xwiki/bin/view/ICT/PureDate/
Thus, "my" problem is to find where ComparisonDateTool is located in this installation and make it works in a legacy XWiki Enterprise 2.4.30451 one.
Wow XE 2.4 is really old...
I don’t remember if the $datetool binding was available and it’s possible that it wasn’t.
FYI it’s located in a java class in the xwiki-velocity*.jar file.
Yes, XE 2.4 is really a paleoXWiki installation! But it is still solving some problems to me here! That pending migration is still a pending migration/upgrade... Some notes on this issue in comments here...
http://atriumkm.idisantiago.es/bin/ICT/PureDate
I'll give it a try ASAP!
Cheers!
Thanks -Vincent
Any help will be welcome! Thank!
On Thu, Jan 19, 2017 at 11:41 PM [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! I've been these last days trying to regain access to an ancient
issue
while dealing with dates. Searching Jira I found this...
http://jira.xwiki.org/browse/XWIKI-5610?jql=text%20~%20%22datetool%22
... and this at XWiki Platforma site...
http://platform.xwiki.org/xwiki/bin/view/SRD/datetool
To the best of my understanding ComparisonDateTool is implemented and accessible through $datetool velocity variable. But I'm not able to get it working.
On Thu, Jan 19, 2017 at 3:54 PM Hamster <[email protected]> wrote:
Have you checked the documentation for the DateTool <
https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
and the ComparisonDateTool <
https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
?
Please, check this page...
http://atriumkm.idisantiago.es/bin/ICT/PureDate
I'm able to get working the examples at DateTool page, but not those at ComparisonDateTool page. Please, could anybody point us in the right direction? Where are we failing?
-- View this message in context:
http://xwiki.475771.n2.nabble.com/jodatime-challenge-tp7602468p7602489.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
Thank you very much for your work!
Ricardo -- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
Hi! On Fri, Jan 20, 2017 at 9:06 AM Vincent Massol <[email protected]> wrote:
Hi,
On 20 Jan 2017, at 08:27, [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! The same code works fine in an XWiki 7.3 installation...
http://portal.idisantiago.es/xwiki/bin/view/ICT/PureDate/
Thus, "my" problem is to find where ComparisonDateTool is located in this installation and make it works in a legacy XWiki Enterprise 2.4.30451 one.
Wow XE 2.4 is really old...
I don’t remember if the $datetool binding was available and it’s possible that it wasn’t.
I'm afraid I don't understand this. I see that velocity-tools-1.4.jar included with XE 2.4 includes DateComparisonTools, as it does velocity-tools-2.0.jar included with XE 7.3. I've replaced both in XE 2.4 with those in XE 7.3 and restarted the container to no avail. DateTool methods work, but ComparisonDateTool don't. http://atriumkm.idisantiago.es/bin/ICT/PureDate I think I don't understand what binding does mean and how could I implement it. Have I any option of getting these methods working in my legacy XE 2.4 installation? I do need to do some date comparisons to show several pieces of information! Thanks for your help!
FYI it’s located in a java class in the xwiki-velocity*.jar file.
Thanks -Vincent
Any help will be welcome! Thank!
On Thu, Jan 19, 2017 at 11:41 PM [IDIS Technical Secretariat] Ricardo Rodríguez <[email protected]> wrote:
Hi! I've been these last days trying to regain access to an ancient
issue
while dealing with dates. Searching Jira I found this...
http://jira.xwiki.org/browse/XWIKI-5610?jql=text%20~%20%22datetool%22
... and this at XWiki Platforma site...
http://platform.xwiki.org/xwiki/bin/view/SRD/datetool
To the best of my understanding ComparisonDateTool is implemented and accessible through $datetool velocity variable. But I'm not able to get it working.
On Thu, Jan 19, 2017 at 3:54 PM Hamster <[email protected]> wrote:
Have you checked the documentation for the DateTool <
https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
and the ComparisonDateTool <
https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/ge...
?
Please, check this page...
http://atriumkm.idisantiago.es/bin/ICT/PureDate
I'm able to get working the examples at DateTool page, but not those at ComparisonDateTool page. Please, could anybody point us in the right direction? Where are we failing?
-- View this message in context:
http://xwiki.475771.n2.nabble.com/jodatime-challenge-tp7602468p7602489.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
Thank you very much for your work!
Ricardo -- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
-- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
--
Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
participants (4)
-
[IDIS Technical Secretariat] Ricardo Rodríguez -
Gerritjan Koekkoek -
Hamster -
Vincent Massol