diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-10-28 15:28:58 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-10-28 15:28:58 +0100 |
commit | b1f3c3bee814ee9fadd4145ade9d9542211d2ee4 (patch) | |
tree | 3f0f859d2c31d9c825a7cacdf41992de0564244b /program/steps/addressbook | |
parent | a23d446996909cf790f771c3702355591dd7664b (diff) |
Fixed saving contact birthday/anniversary dates before 01-01-1970
Diffstat (limited to 'program/steps/addressbook')
-rw-r--r-- | program/steps/addressbook/save.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc index 2adc53bcf..7911802b9 100644 --- a/program/steps/addressbook/save.inc +++ b/program/steps/addressbook/save.inc @@ -80,8 +80,8 @@ foreach ($GLOBALS['CONTACT_COLTYPES'] as $col => $colprop) { // normalize the submitted date strings if ($colprop['type'] == 'date') { - if ($timestamp = rcube_utils::strtotime($a_record[$col])) { - $a_record[$col] = date('Y-m-d', $timestamp); + if ($a_record[$col] && ($dt = rcube_utils::anytodatetime($a_record[$col]))) { + $a_record[$col] = $dt->format('Y-m-d'); } else { unset($a_record[$col]); |