On 02/17/2010 11:13 AM, Guillaume Lerouge wrote:
Hi,
2010/2/17 Hernández Cuchí, Francisco Ricardo<francisco.hernandez(a)oepm.es>
Thanks! I just got it.
And to format the dato to be dd-mm-yyyy?
$xwiki.formatDate($todoDoc.creationDate, 'dd-MM-yyyy') or something like
that, you can check the API.
Be careful, small m = minutes, large M = month. You can see all the
formatting letters here:
http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
Guillaume
> Francisco
>
> -----Mensaje original-----
> De: users-bounces(a)xwiki.org [mailto:users-bounces@xwiki.org] En nombre de
> Marius Dumitru Florea
> Enviado el: miércoles, 17 de febrero de 2010 8:37
> Para: XWiki Users
> Asunto: Re: [xwiki-users] How to get the creation date of a document
>
> Hi Hernández,
>
> Hernández Cuchí wrote:
>> Hello,
>>
>>
>>
>
>> I am rewriting the "todo" example list to be suitable for my company.
I
> would like to show in the list the date of creation of the documents. How
> can i get it?
>
> See
>
>
http://platform.xwiki.org/xwiki/bin/download/DevGuide/API/xwiki-core-2.2-ja…
>
>>
>>
>>
>> The code is something like:
>>
>>
>>
>> <table id="todoTable" class="grid sortable filterable
doOddEven"
> cellpadding="0" cellspacing="0" border="0">
>>
>> <tr class="sortHeader">
>>
>> <th class="unsortable selectFilter">Fecha</th>
>>
>> <th>Resumen</th>
>>
>> <th>Status</th>
>>
>> <th>Persona</th>
>>
>> <th>Pestaña</th>
>>
>> <th class="unsortable selectFilter">Descripcion</th>
>>
>> </tr>
>>
>> #foreach ($todo in $todos)
>>
>> <tr>
>>
>> #set ($todoDoc = $xwiki.getDocument($todo))
>>
>> #set ($todoObj = $todoDoc.getObject("XWiki.TodoClass"))
>>
>> <td>[$todoObj.TargetDate>$todo]</td>
>>
>> <td>[$todoObj.Resumen>$todo]</td>
>>
>> <td>[$todoObj.Status>$todo]</td>
>>
>> <td>[$todoObj.Persona>$todo]</td>
>>
>> <td>[$todoObj.Pestana>$todo]</td>
>>
>> <td>$todoObj.Descripcion</td>
>>
>>
>>
>> </tr>
>>
>> #end
>>
>> </table>
>>
>>
>>
>
>> So get from the todoobj the creation date.
>
> You can't get it from the object, afaik, but from the document:
>
> $todoDoc.creationDate
>
> Hope this helps,
> Marius
>
>>
>>
>>
>> Regards,
>>
>>
>>
>> Francisco
>>
>>
>>
>> --
>>
>> Francisco Hernández Cuchí
>>
>> Jefe de Servicios Sistemas de Información
>>
>> OFICINA ESPAÑOLA DE PATENTES Y MARCAS
>>
>> C\ Paseo de la Castella 75
>>
>> tlf: 913496844
>>
>> mail: francisco.hernandez@oepm.es<mailto:francisco.hernandez@oepm.es>
>>
--
Sergiu Dumitriu
http://purl.org/net/sergiu/