Ralf Posted May 23, 2014 Posted May 23, 2014 Hi,there are in the meantime a lots of Q&As about the Admin Page List but actually I missed one.Is it possible to output a "Date"-Field ??Because only with the name of the Field I get back a Timestamp...Thanks
renobird Posted May 23, 2014 Posted May 23, 2014 Hi Ralf, Does the date field have an output format set? I've never attempted to show a date field in the admin list, but that's where I would start. 3
Ralf Posted May 23, 2014 Author Posted May 23, 2014 shame over me it was tooo late last night... you are right, my date field haven´t an output format set because I didn´t need it until now. 1
Ivan Gretsky Posted September 9, 2016 Posted September 9, 2016 That is the topic I was looking for... What if I need to output a created date? Could not find output formatting for it.
adrian Posted September 9, 2016 Posted September 9, 2016 48 minutes ago, Ivan Gretsky said: That is the topic I was looking for... What if I need to output a created date? Could not find output formatting for it. I don't think this is an option - I think you need to format yourself with something like PHP's date() 1
LostKobrakai Posted September 9, 2016 Posted September 9, 2016 created is a native field without fieldtype, therefore there's no formatted to unformatted distinction (which is part of fieldtypes logic). 1
Ivan Gretsky Posted September 9, 2016 Posted September 9, 2016 So there is no way to format it in List of fields to display in the admin Page List template config? I could not put no php functions like date() in there. Am I missing something obvious?
Robin S Posted September 9, 2016 Posted September 9, 2016 You can use a hook to append a formatted created date to the end of the page list label. In /site/ready.php... $this->addHookAfter('ProcessPageListRender::getPageLabel', function($event) { $page = $event->arguments('page'); $created = date('d/m/y', $page->created); $event->return .= " $created"; }); 7
KarlvonKarton Posted July 24, 2019 Posted July 24, 2019 On 9/10/2016 at 12:29 AM, Robin S said: You can use a hook to append a formatted created date to the end of the page list label. In /site/ready.php... Where to use this hook? In a module?
KarlvonKarton Posted July 24, 2019 Posted July 24, 2019 Never mind... In the ready.php of course... Sorry for being too quick and not testing first ;-)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now