From b1f3c3bee814ee9fadd4145ade9d9542211d2ee4 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 28 Oct 2013 10:28:58 -0400
Subject: [PATCH] Fixed saving contact birthday/anniversary dates before 01-01-1970

---
 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 2adc53b..7911802 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -80,8 +80,8 @@
 
     // 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]);

--
Gitblit v1.9.1