risingisland
Thanks for the code. Unfortunately I don't get the correct date.
The config is used to easily insert PDF files with name, file upload and time.
Config:
<? php
$ settings ['display'] = 'vertical';
$ settings ['fields'] = array (
'text' => array (
'caption' => 'Title',
'type' => 'text'
),
'file' => array (
'caption' => 'File',
'type' => 'file'
),
'date' => array (
'caption' => 'Date',
'type' => 'date'
)
);
$ settings ['templates'] = array (
'outerTpl' => '[+ wrapper +]',
'rowTpl' => '<section>
<h5><a href="((file))">((text))</a></h5><p>((date))</p></section> '
);
$ settings ['configuration'] = array (
'enablePaste' => true,
'enableClear' => true,
'csvseparator' => ','
);
function formatdate ($ data, $ modx, $ _multiTV)
{
$ data ['date'] = strftime ("% d.% m.% Y", $ data ['date']);
return $ data;
};
$ settings ['prepare'] = 'formatdate';
Unfortunately, 01.01.1970 is still issued.
The multiTV call is:
[[multiTV?
&tvName=`pdf`
&docid=`[*id*]`
&tplConfig=``
&outerTpl=`@CODE: <div class="features">((wrapper))</div>`
&rowTpl=`<section><h5><a href="((file))">((text))</a></h5><p>((date))</p></section>`
&display=`all`
&rows=`all`
&orderBy=`date DESC`
&prepare=`formatdate`
]]
If it works for you - have i missed something important?