summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-10-28 15:28:58 +0100
committerAleksander Machniak <alec@alec.pl>2013-10-28 15:28:58 +0100
commitb1f3c3bee814ee9fadd4145ade9d9542211d2ee4 (patch)
tree3f0f859d2c31d9c825a7cacdf41992de0564244b /program/steps
parenta23d446996909cf790f771c3702355591dd7664b (diff)
Fixed saving contact birthday/anniversary dates before 01-01-1970
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/addressbook/save.inc4
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]);