7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Format Time.Nice (in the CMS)?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1063 Views |
-
Format Time.Nice (in the CMS)?

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 -
Re: Format Time.Nice (in the CMS)?

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'
-
Re: Format Time.Nice (in the CMS)?

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 -
Re: Format Time.Nice (in the CMS)?

12 August 2010 at 3:05pm
No, the popup is configured by your getCMSFields() function, not $summary_fields.
| 1063 Views | ||
|
Page:
1
|
Go to Top |

