Hallo zusammen,
seit dem gestrigen Update auf Joey 2012.10.1 habe ich wieder das alte Geburtstagsproblem unter Android - sprich die Geburtstage werden einen Tag früher im Adressbuch angezeitgt. Unter Miland habe ich dieses Verhalten mit dem "addHour(12)" TRick behoben.
Milan-Syntax:
case 'bday':
if(strtolower($this->_device->devicetype) == 'iphone'){
if($data->$value instanceof DateTime) {
$nodeContent = $data->bday->format("Y-m-d\TH:i:s") . '.000Z';
}
}
/* START MOD FOR ANDROID */
else{
if($data->$value instanceof DateTime) {
$userTimezone = Tinebase_Core::get(Tinebase_Core::USERTIMEZONE);
$data->bday->setTimezone($userTimezone);
$data->bday->addHour(12);
$data->bday = new Tinebase_DateTime($data->bday->format(Tinebase_Record_Abstract::ISO8601LONG), 'UTC');
$nodeContent = $data->bday->format("Y-m-d");
}
}
/* END MOD FOR ANDROID */
break;
Leider schaffe ich es nicht diesen Mod unter Joey umzusetzen. Hat da jemand eine Idee?
case 'bday':
#$isoDate = (string)$data->$fieldName;
$contact->$value = new Tinebase_DateTime($data->$fieldName);
if (
// ($this->_device->devicetype == Syncroton_Model_Device::TYPE_WEBOS) || // only valid versions < 2.1
($this->_device->devicetype == Syncroton_Model_Device::TYPE_IPHONE && $this->_device->getMajorVersion() < 800)/* ||
preg_match("/^\d{4}-\d{2}-\d{2}$/", $isoDate)*/
) {
// iOS < 4 & webow < 2.1 send birthdays to the entered date, but the time the birthday got entered on the device
// acutally iOS < 4 somtimes sends the bday at noon but the timezone is not clear
// -> we don't trust the time part and set the birthdays timezone to the timezone the user has set in tine
$userTimezone = Tinebase_Core::get(Tinebase_Core::USERTIMEZONE);
$contact->$value = new Tinebase_DateTime($contact->bday->setTime(0,0,0)->format(Tinebase_Record_Abstract::ISO8601LONG), $userTimezone);
$contact->$value->setTimezone('UTC');
}
/* START ANDROID MOD*/
else{
$userTimezone = Tinebase_Core::get(Tinebase_Core::USERTIMEZONE);
$contact->$value = new Tinebase_DateTime($contact->bday->addHour(12)->setTime(0,0,0)->format(Tinebase_Record_Abstract::ISO8601LONG), $userTimezone);
$contact->$value->setTimezone('UTC');
}
/* END ANDROID MOD*/
break;
So geht es leider nicht...
Danke schon an alle Helfer.


