Antonio Goncalves wrote:
> It's me again. I'm still confused by the property classes.
> The dueDate is of type DateProperty. How can have the milliseconds value of
> that date ? I've tried to format the date, but it doesn't work. If I display
> $todoObj.TargetDate, it's fine, but I can manipulate it as a date (
> using formatDate for exemple)
>
> #foreach ($todo in $todos)
> #set ($todoDoc = $xwiki.getDocument($todo))
> #set ($todoObj = $todoDoc.getObject("XWiki.TodoClass"))
>
> $todoObj.TargetDate
> // This works
> $xwiki.formatDate($todoObj.TargetDate, "yymmdd") // This does'n
> work
> #end
>
> Do you know what to do to use formatDate on a DateProperty ?
>
$xwiki.formatDate($todoObj.getProperty("TargetDate").value, "yymmdd")
$todoObj.TargetDate formats the date into a string.
$todoObj.getProperty("TargetDate").value is the actual value of the
property, which is a Date for date properties.
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users