Datetime winget on single page

Permalink
Hello. I'm trying to add datetime widget to single page like this:
print Core::make( 'helper/form/date_time' )->datetime( 'published_at', $article['published_at'] );

The documentation says: When using the datetime() method, it creates multiple fields that must be combined using the translate() method. The save() method must be extended in the block controller to use translate().
In my single page controller i'm trying to get input data:
$published_at = Core::make('helper/form/date_time')->translate( $this->post('published_at') );

But $published_at variable is always equal to NULL.
So what's the difference between using datetime in block controller and single page controller?
And where i'm mistaken?

vr5
 
hutman replied on at Permalink Best Answer Reply
hutman
I think you just need to change this
$published_at = Core::make('helper/form/date_time')->translate( $this->post('published_at') );

to this
$published_at = Core::make('helper/form/date_time')->translate('published_at');

And it by default checks the post and translates the date.
vr5 replied on at Permalink Reply
vr5
Thanks) It's working