mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-24 17:36:39 +00:00
transform date from iOS to standart format
This commit is contained in:
parent
01a6873d4a
commit
66dd28addc
@ -94,11 +94,19 @@ elseif ( stripos($last_modified, 'TZ') ) {
|
||||
$vcard->AddProperty('REV',$last_modified);
|
||||
}
|
||||
elseif( preg_match('{^(\d{8})(\d{6})Z?}', $last_modified, $matches) ) {
|
||||
// 'T' missing
|
||||
$last_modified = $matches[1] . 'T' . $matches[2] . 'Z';
|
||||
$vcard->ClearProperties('REV');
|
||||
$vcard->AddProperty('REV',$last_modified);
|
||||
}
|
||||
elseif( preg_match('{([0-9]{4})-([0-9]{2})-([0-9]{2}T)([0-9]{2}):([0-9]{2}):([0-9]{2})Z?}', $last_modified, $matches) ){
|
||||
// iOS sends these, see http://tools.ietf.org/html/rfc2426#section-3.6.4
|
||||
$last_modified = $matches[1] . $matches[2] .$matches[3] .$matches[4] .$matches[5]. $matches[6] . 'Z';
|
||||
$vcard->ClearProperties('REV');
|
||||
$vcard->AddProperty('REV', $last_modified);
|
||||
}
|
||||
elseif( !preg_match('{^\d{8}T\d{6}Z$}', $last_modified) ) {
|
||||
// reset to timestamp format, see https://tools.ietf.org/html/rfc6350#section-6.7.4
|
||||
$last_modified = gmdate( 'Ymd\THis\Z' );
|
||||
$vcard->ClearProperties('REV');
|
||||
$vcard->AddProperty('REV',$last_modified);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user