Path

ez projects / ezfeedparse / forum / general / how gettimestamp of an entry ?


How getTimestamp of an entry ?

You need to be logged in to post messages in the forums. New users may register here.

Guillaume Kulakowski

Member since:
09 January 2008

Posts: 23

Tuesday 14 July 2009 3:25:09 pm

Hi Damien,

I use your extension for generate a list. The problem is that I can't access to the published date. $item.published.date give me a DateTime object with no public property...

Logica WebFactory
My blog : http://www.llaumgui.com (not in eZ Publish ;-))

Up

Francesco Trucchia

Member since:
09 January 2008

Posts: 3

Wednesday 22 July 2009 7:14:22 pm

We have the same problem.

The problem is that the object DateTime returned from ezcFeedDateElement doesn't have public properties that can be accessed.

We wrote a little workaround:




Index: extension/ezfeedparse/classes/eztemplateobject.php


===================================================================


--- extension/ezfeedparse/classes/eztemplateobject.php  (revision 7)


+++ extension/ezfeedparse/classes/eztemplateobject.php  (working copy)


@@ -40,6 +40,10 @@


        $val = $this->object->$name;


        if ( is_object( $val ) )


        {


+           if ( $val instanceof DateTime )


+           {


+             return $val->format( 'U' );


+           }


            return new eZTemplateObject( $val );


        }


        else if ( is_array( $val ) )


--
Francesco Trucchia
CTO

ft@ideato.it
Skype: trucchia

ideato srl - web ideas for sale
http://www.ideato.it

Up

Damien Pobel

Member since:
19 September 2005

Posts: 40

Friday 23 October 2009 11:08:10 pm

Thanks for the report and the patch, this is now fixed in trunk and in the 0.2 version.

Damien
Blog: http://damien.pobel.fr/
Planet eZ Publish.fr : http://www.planet-ezpublish.fr/

Up

You need to be logged in to post messages in the forums. New users may register here.