Skip to content

Commit

Permalink
Bugfix in conversion of dates and timestamps.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mplus Software committed Aug 5, 2014
1 parent f35320a commit 389c2c2
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Mplusqapiclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class MplusQAPIclient
{
const CLIENT_VERSION = '0.3.0';
const CLIENT_VERSION = '0.3.1';

var $MIN_API_VERSION_MAJOR = 0;
var $MIN_API_VERSION_MINOR = 3;
Expand Down Expand Up @@ -904,6 +904,12 @@ public function parseGetTableOrderResult($soapGetTableOrderResult) {
if (isset($soapGetTableOrderResult->order)) {
$soapOrder = $soapGetTableOrderResult->order;
$order = objectToArray($soapOrder);
if (isset($order['financialDate'])) {
$order['financialDate'] = $this->parseMplusDate($order['financialDate']);
}
if (isset($order['entryTimestamp'])) {
$order['entryTimestamp'] = $this->parseMplusDateTime($order['entryTimestamp']);
}
if (isset($order['lineList']['line'])) {
$order['lineList'] = $order['lineList']['line'];
}
Expand Down Expand Up @@ -1580,6 +1586,11 @@ public function convertMplusDateTime($timestamp)
'day' => date('j', $timestamp),
'mon' => date('n', $timestamp),
'year' => date('Y', $timestamp),
'hour' => date('H', $timestamp),
'min' => date('i', $timestamp),
'sec' => date('s', $timestamp),
'isdst' => false,
'timezone' => 0,
);
} // END convertMplusDateTime()

Expand All @@ -1602,11 +1613,6 @@ public function convertMplusDate($timestamp)
'day' => date('j', $timestamp),
'mon' => date('n', $timestamp),
'year' => date('Y', $timestamp),
'hour' => date('H', $timestamp),
'min' => date('i', $timestamp),
'sec' => date('s', $timestamp),
'isdst' => false,
'timezone' => 0,
);
} // END convertMplusDate()

Expand Down

0 comments on commit 389c2c2

Please sign in to comment.