summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-12-06 20:35:56 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-12-06 20:35:56 +0000
commit0b2253627c2043fe5a119ee43891246719a6e370 (patch)
tree620bf84988bee3b6b146ab867f81633f8ed06ab2
parent3beb6aa384e631544a9dea831a7ed84df54e3ec1 (diff)
added function getting timezone description
git-svn-id: http://svn.miranda-ng.org/main/trunk@2673 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/m_timezones.h1
-rw-r--r--src/modules/utils/timezones.cpp13
2 files changed, 14 insertions, 0 deletions
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;
}