Jump to content

Recommended Posts

Posted

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

Posted

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.

  • Like 3
Posted

:-[ 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.

  • Like 1
  • 2 years later...
Posted
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()

  • Like 1
Posted

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?

Posted

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";
});

 

  • Like 7
  • 2 years later...
Posted
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? 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...