Hallo Community, wenn ich im Backend z.B. unter Marketing->Partnerprogramm eine Statistik aufrufe. Und dort im Kalender den 31.07.2013 wähle, die Statistik mir downloaden möchte, erhalte ich: DateTime::\_\_construct() [datetime.--construct]: Failed to parse time string (2013-07-32) at position 9 (2): Unexpected character in Shopware/Controllers/Backend/Partner.php on line 379 Stack trace: #0 Shopware/Controllers/Backend/Partner.php(379): DateTime-\>\_\_construct('2013-07-32') #1 Shopware/Controllers/Backend/Partner.php(313): Shopware\_Controllers\_Backend\_Partner-\>getToDate() #2 Enlight/Controller/Action.php(148): Shopware\_Controllers\_Backend\_Partner-\>downloadStatisticAction() #3 Enlight/Controller/Dispatcher/Default.php(521): Enlight\_Controller\_Action-\>dispatch('downloadStatist...') #4 Enlight/Controller/Front.php(214): Enlight\_Controller\_Dispatcher\_Default-\>dispatch(Object(Enlight\_Controller\_Request\_RequestHttp), Object(Enlight\_Controller\_Response\_ResponseHttp)) #5 Shopware/Components/HttpCache/HttpKernel.php(79): Enlight\_Controller\_Front-\>dispatch() #6 Symfony/Component/HttpKernel/HttpCache/HttpCache.php(434): Shopware\Components\HttpCache\HttpKernel-\>handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #7 Shopware/Components/HttpCache/AppCache.php(234): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #8 Symfony/Component/HttpKernel/HttpCache/HttpCache.php(230): Shopware\Components\HttpCache\AppCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true) #9 Shopware/Components/HttpCache/AppCache.php(99): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>pass(Object(Symfony\Component\HttpFoundation\Request), true) #10 Shopware/Bootstrap.php(70): Shopware\Components\HttpCache\AppCache-\>handle(Object(Symfony\Component\HttpFoundation\Request)) #11 Enlight/Application.php(192): Shopware\_Bootstrap-\>run() #12 shopware.php(83): Enlight\_Application-\>run() #13 {main}
In der Function convertDate im Template _default/backend/partner/controller/statistic.js wird + 1 Tag gerechnet. :shock: Merkwürdigerweise stimmen die Downloads bei allen Tagen außer an einem 31. Tag… /\*\* \* convert the date object for the request \* \* @param date \*/ convertDate:function(date){ var day = (date.getDate() +1 \< 10) ? "0" + date.getDate() : date.getDate() +1; var month = (date.getMonth() +1 \< 10) ? "0" + (date.getMonth() +1) : date.getMonth() +1; var year = date.getFullYear(); return year+"-"+month+"-"+day; }
Bleibt wohl die Option übrig, per If-Abfrage den 31. Tag abzufragen, oder? Grüße Mathias