Jump to content

Date field as field in the Admin Page List?


Ralf
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • 2 years later...
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
Link to comment
Share on other sites

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 6
Link to comment
Share on other sites

  • 2 years later...

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
 Share

  • Recently Browsing   0 members

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