Fix intenaldate parser

This commit is contained in:
RainLoop Team 2014-07-31 00:57:41 +04:00
parent 1de1ecc9c4
commit 7dc9441852
12 changed files with 199 additions and 184 deletions

View file

@ -55,7 +55,13 @@ class DateTimeHelper
*/
public static function ParseInternalDateString($sDateTime)
{
$oDateTime = \DateTime::createFromFormat('d-M-Y H:i:s O', \trim($sDateTime), \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject());
$sDateTime = \trim($sDateTime);
if (\preg_match('/^[a-z]{2,4}, /i', $sDateTime)) // RFC2822
{
return \MailSo\Base\DateTimeHelper::ParseRFC2822DateString($sDateTime);
}
$oDateTime = \DateTime::createFromFormat('d-M-Y H:i:s O', $sDateTime, \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject());
return $oDateTime ? $oDateTime->getTimestamp() : 0;
}

View file

@ -1800,7 +1800,7 @@ class Actions
$oItem->SetReplyTo(isset($aItem['ReplyTo']) ? $aItem['ReplyTo'] : '');
$oItem->SetBcc(isset($aItem['Bcc']) ? $aItem['Bcc'] : '');
$oItem->SetSignature(isset($aItem['Signature']) ? $aItem['Signature'] : '');
if ('' !== $oItem->Id())
{
\array_push($aIdentities, $oItem);
@ -5829,7 +5829,7 @@ class Actions
return $this->DefaultResponse(__FUNCTION__, $mResult);
}
/**
* @return array
*/
@ -5838,7 +5838,7 @@ class Actions
$oAccount = $this->getAccountFromToken();
$mResult = false;
$sUrl = $this->GetActionParam('Url', '');
$sAccessToken = $this->GetActionParam('AccessToken', '');
$sGoogleApiKey = (string) $this->Config()->Get('social', 'google_api_key', '');

View file

@ -179,7 +179,9 @@
<span class="i18n uiLabel labelTo" data-i18n-text="MESSAGE/LABEL_TO"></span>:
<span class="to" data-bind="html: viewToShort, title: viewTo"></span>
</span>
(<span class="date" data-bind="text: viewDate"></span>)
<span data-bind="visible: '' !== viewDate()">
(<span class="date" data-bind="text: viewDate"></span>)
</span>
</div>
<div class="clearfix"></div>
</div>
@ -205,7 +207,7 @@
&nbsp;
<span class="bcc" data-bind="text: viewBcc, title: viewBcc"></span>
</div>
<div>
<div data-bind="visible: '' !== viewDate()">
<span class="i18n uiLabel labelBcc" data-i18n-text="MESSAGE/LABEL_DATE"></span>:
&nbsp;
<span class="date" data-bind="text: viewDate"></span>