Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Format Time.Nice (in the CMS)?


Reply


4 Posts   1425 Views

Avatar
socks

Community Member, 190 Posts

11 August 2010 at 5:59pm

I have it working on the front-end, but didn't know if it was possible to format a field as Time.Nice within DOM in the CMS.

thanks,
Clint

Avatar
UncleCheese

4085 Posts

12 August 2010 at 1:38am

Just use a custom getter.

public function getNiceTime() {
return $this->obj('YourTimeField')->Nice();
}

and in your summary fields:

'NiceTime' => 'Time'

Avatar
socks

Community Member, 190 Posts

12 August 2010 at 2:06pm

I got that to work, thanks Uncle Cheese.

Is it supposed to work in the Popup as well? I was getting a blank field when going back into the Popup to edit. Not that big of a deal if it doesn't.

thanks again,
Clint

Avatar
UncleCheese

4085 Posts

12 August 2010 at 3:05pm

No, the popup is configured by your getCMSFields() function, not $summary_fields.