From bc8396728b4b500e7349d84bc58b9ee300d592df Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Mon, 22 Dec 2014 09:27:38 +0000 Subject: UserInfoEx: fix for birthday reminder when year not set git-svn-id: http://svn.miranda-ng.org/main/trunk@11575 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/UserInfoEx/src/classMAnnivDate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index b736d434d4..73fb57c38c 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -109,7 +109,6 @@ void MAnnivDate::SetDate(MAnnivDate &mda) __inline BYTE MAnnivDate::IsValid() const { return ( - Year() > 1600 && Month() > 0 && Month() < 13 && Day() > 0 && Day() <= DaysInMonth(Month()) ); @@ -194,6 +193,9 @@ int MAnnivDate::Age(MTime *pNow) if (pNow) now = *pNow; else now.GetLocalTime(); + if (Year() == 0) + return 0; + age = now.Year() - Year(); if (age > 1 && CompareDays(now) > 0) age--; @@ -343,7 +345,6 @@ int MAnnivDate::DBGetDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPC ZeroDate(); WORD wtmp = db_get_w(hContact, pszModule, szYear, 0); - if (wtmp < 1601) return 1; Year(wtmp); wtmp = db_get_w(hContact, pszModule, szMonth, 0); -- cgit v1.2.3