Issues

ZF-9807: getPosts date option formatting incorrect or not clear in documentation

Issue Type: Bug Created: 2010-05-05T10:02:05.000+0000 Last Updated: 2011-08-26T17:31:25.000+0000 Status: Resolved Fix version(s): - Next Major Release ()

Reporter: Ray Mosley (raymosley) Assignee: Thomas Weidner (thomas) Tags: - Zend_Service_Delicious

Related issues: Attachments:

Description

The delicious api allows for filtering by date in the api: http://delicious.com/help/api#posts_get

However the implmentation in zend_service_delicious is not in the correct format even though a correctly formatted date is passed through using Zend_Date.

The format that can work is (line 290 onwards):

<pre class="highlight">
 $parms = array();
        if ($tag) {
            $parms['tag'] = $tag;
        }
        if ($url) {
            $parms['url'] = $url;
        }
        if ($dt) {
            $parms['dt'] = $dt->get('Y-M-d')."T".$dt->get('H:m:s')."Z";
        }

        $response = $this->makeRequest(self::PATH_POSTS_GET, $parms);
        return $this->_parseXmlPostList($response);

yet the current code will output an incorrect format where months are implimented as minutes and the forward slashes do not create the literal T and Z chracters needed. If some other formatting is required before passing the date then this should be documented better in http://framework.zend.com/manual/en/zend.date.html

Current code:

<pre class="highlight">
$parms = array();
        if ($tag) {
            $parms['tag'] = $tag;
        }
        if ($url) {
            $parms['url'] = $url;
        }
        if ($dt) {
            $parms['dt'] = $dt->get('Y-m-d\TH:i:s\Z');
        }

        $response = $this->makeRequest(self::PATH_POSTS_GET, $parms);

        return $this->_parseXmlPostList($response);

Comments

Posted by Thomas Weidner (thomas) on 2011-08-26T17:31:25.000+0000

Fixed in ZF2 with GH-331

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts