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   1415 Views

Avatar
socks

11 August 2010 at 5:59pm Community Member, 190 Posts

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

12 August 2010 at 1:38am 4085 Posts

Just use a custom getter.

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

and in your summary fields:

'NiceTime' => 'Time'

Avatar
socks

12 August 2010 at 2:06pm Community Member, 190 Posts

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

12 August 2010 at 3:05pm 4085 Posts

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