mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
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:
parent
92f2caf700
commit
1fb553e77e
249 changed files with 1338 additions and 1453 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue