Remote Synchronization (CardDAV) improvements:

now it supports address book url auto detection (and works with Google contacts, icloud and etc.)
This commit is contained in:
RainLoop Team 2015-05-09 02:43:56 +04:00
parent 92f2caf700
commit 1fb553e77e
249 changed files with 1338 additions and 1453 deletions

View file

@ -86,4 +86,21 @@ class DateTimeHelper
$oDateTime = \DateTime::createFromFormat('Y-m-d H:i:s O', \trim($sDateTime), \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject());
return $oDateTime ? $oDateTime->getTimestamp() : 0;
}
/**
* Parse date string formated as "2015-05-08T14:32:18.483-07:00"
*
* @param string $sDateTime
*
* @return int
*/
public static function TryToParseSpecEtagFormat($sDateTime)
{
$sDateTime = \trim(\preg_replace('/ \([a-zA-Z0-9]+\)$/', '', \trim($sDateTime)));
$sDateTime = \trim(\preg_replace('/(:[\d]{2})\.[\d]{3}/', '$1', \trim($sDateTime)));
$sDateTime = \trim(\preg_replace('/(-[\d]{2})T([\d]{2}:)/', '$1 $2', \trim($sDateTime)));
$sDateTime = \trim(\preg_replace('/([\-+][\d]{2}):([\d]{2})$/', ' $1$2', \trim($sDateTime)));
return \MailSo\Base\DateTimeHelper::ParseDateStringType1($sDateTime);
}
}