summaryrefslogtreecommitdiff
path: root/plugins/TipperYM
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-04-14 15:08:48 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-04-14 15:08:48 +0000
commit583f3768d24ceb7b0bee451f9a0975d25f826ee6 (patch)
tree1b46347b93db6161767d9855d75bdbae7974b4a3 /plugins/TipperYM
parent63b408f1d2d8e88da9275da8cf5d4fe5665cefe3 (diff)
Tipper: date without year is valid
git-svn-id: http://svn.miranda-ng.org/main/trunk@16652 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM')
-rw-r--r--plugins/TipperYM/src/translations.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index c20915147e..8e85ebd902 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -249,23 +249,20 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha
db_free(&dbv);
mir_snprintf(szSettingName, "%sYear", prefix);
int year = 0;
- if (!db_get(hContact, szModuleName, szSettingName, &dbv))
- {
- if (GetInt(dbv, &year) && year != 0)
- {
- db_free(&dbv);
+ db_get(hContact, szModuleName, szSettingName, &dbv);
- SYSTEMTIME st = {0};
- st.wDay = day;
- st.wMonth = month;
- st.wYear = year;
+ GetInt(dbv, &year);
+ db_free(&dbv);
- GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, 0, buff, bufflen);
- return buff;
- }
- else
- db_free(&dbv);
- }
+ tm time = { 0 };
+ time.tm_mday = day;
+ time.tm_mon = month - 1;
+ time.tm_year = year - 1900;
+
+ _tcsftime(buff, bufflen, _T("%x"), &time);
+
+ return buff;
+
}
else
db_free(&dbv);