Hi [Ricardo Rodriguez] eBioTIC. wrote: > Hi Eugen, > > Eugen Colesnicov wrote: > >> Hi Sergiu! >> >> I played before with jodatime. It have some problems ... >> For example, I tried to use example script from plugin home page (it can be >> usefull in my situation) and this script doesn't working: >> #set($formatter = >> $xwiki.jodatime.getDateTimeFormatterForPattern('yyyy.MM.dd')) >> #set($myBirthday = $formatter.parseDateTime('2007.11.25')) >> #set($daysLeft = $myBirthday.minus($now.millis)) >> $daysLeft.getDayOfYear() days left till my birthday! >> >> Also joda time is badly described - for all these reasons I used datetool. >> >> > > Have you tried to use Velocity ComparisonDateTool? I'm able to use > DateTool like you, but I don't know how to call methods from > ComparisonDateTool. Are they available within Xwiki? Thanks! > > http://ebiotic.net/bin/ICT/Date >
As you said: reading attentively the documentation is required to get this working! Following http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting#HVelocitySpecificInformation I modified xwiki.properties to include... http://velocity.apache.org/tools/releases/1.4/javadoc/org/apache/velocity/tools/generic/ComparisonDateTool.html by adding... velocity.tools = comparisondatetool = org.apache.velocity.tools.generic.ComparisonDateTool It seems to me that the subclass is not available as the current date is printed if I use $comparisondatetool, but I'm not able yet to use its methods. (I've also checked that the required Velocity Tools library release is available ./WEB-INF/lib/velocity-tools-1.4.jar ) http://ebiotic.net/bin/ICT/Date Please, could you/anybody give an example? Thanks! >> About query ... Better for me - XWQL, but all my tryings to use any dates in >> XWQL gives some errors (most of all - java errors in a translation from XWQL >> to hql ...). I am not a professional in a XWQL and HQL (I am not sure - this >> is my error or bug), and Ricardo gave working example of using HQL - for >> this reason I used ready query example. >> >> If you can give working example of using dates in a XWQL - will be great! >> Also I tried examples from here: >> http://dev.xwiki.org/xwiki/bin/view/DesignArchive/XWikiQueryLanguageSpecification >> (second script) - but give me error. >> >> >> >> >> >> >> > > Cheers, -- Ricardo RodrÃguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users