From 0b2253627c2043fe5a119ee43891246719a6e370 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 6 Dec 2012 20:35:56 +0000 Subject: added function getting timezone description git-svn-id: http://svn.miranda-ng.org/main/trunk@2673 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/m_timezones.h | 1 + src/modules/utils/timezones.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/m_timezones.h b/include/m_timezones.h index cf8fda340b..e9c103229a 100644 --- a/include/m_timezones.h +++ b/include/m_timezones.h @@ -55,6 +55,7 @@ typedef struct LPTIME_ZONE_INFORMATION (*getTzi)(HANDLE hTZ); LPCTSTR (*getTzName)(HANDLE hTZ); + LPCTSTR (*getTzDescription)(LPCTSTR TZname); #ifdef __cplusplus int printDateTimeByContact (HANDLE hContact, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags) diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index dcdc68b32d..1f2a4f1306 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -129,6 +129,18 @@ static LPCTSTR timeapiGetTzName(HANDLE hTZ) return tz->tszName; } +static LPCTSTR timeapiGetTzDescription(LPCTSTR TZname) +{ + for (int i=0; i < g_timezonesBias.getCount(); i++) + { + MIM_TIMEZONE *tz = g_timezonesBias[i]; + + if (!lstrcmp(tz->tszName, TZname)) + return tz->szDisplay; + } + return _T(""); +} + static void CalcTsOffset(MIM_TIMEZONE *tz) { SYSTEMTIME st, stl; @@ -466,6 +478,7 @@ static INT_PTR GetTimeApi(WPARAM, LPARAM lParam) tmi->timeStampToTimeZoneTimeStamp = timeapiTimeStampToTimeZoneTimeStamp; tmi->getTzi = timeapiGetTzi; tmi->getTzName = timeapiGetTzName; + tmi->getTzDescription = timeapiGetTzDescription; return TRUE; } -- cgit v1.2.3