[xwiki-users] groovy date setting
Hi, def vPublishDate = "2008/10/28 12:00:00" vObjArticle.set("publishDate",vPublishDate) But when I look at the page it shows 31/03/0034 12:00:00 Any explanation how to handle dates with groovy for xwiki? Gerritjan
Hi, In the Date property, you can define the pattern for string conversion. It seems, from what is displayed, that default pattern is "dd/MM/yyyy hh:mm:ss". So the string you pass to the vObjArticle.set() should be something like "28/10/2008" and not "2008/10/28" IMO, or you should change the pattern in the class property. Jeremie 2010/3/20 Gerritjan Koekkoek <gerritjankoekkoek@gmail.com>
Hi,
def vPublishDate = "2008/10/28 12:00:00" vObjArticle.set("publishDate",vPublishDate)
But when I look at the page it shows 31/03/0034 12:00:00
Any explanation how to handle dates with groovy for xwiki?
Gerritjan _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
On 03/20/2010 04:12 PM, Gerritjan Koekkoek wrote:
Hi,
def vPublishDate = "2008/10/28 12:00:00" vObjArticle.set("publishDate",vPublishDate)
But when I look at the page it shows 31/03/0034 12:00:00
Any explanation how to handle dates with groovy for xwiki?
The format of the string that you're pushing is not the same as the one expected by the property. If you prefer yyyy/MM/dd HH:mm:ss, then you should put this format also in the class. If not, then write the date in the expected format: 28/10/2008 12:00:00 -- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (3)
-
Gerritjan Koekkoek -
Jeremie BOUSQUET -
Sergiu Dumitriu