+namespace
+{
+
+// helper function used by GetEnglish/WeekDayName(): returns 0 if flags is
+// Name_Full and 1 if it is Name_Abbr or -1 if the flags is incorrect (and
+// asserts in this case)
+//
+// the return value of this function is used as an index into 2D array
+// containing full names in its first row and abbreviated ones in the 2nd one
+int NameArrayIndexFromFlag(wxDateTime::NameFlags flags)
+{
+ switch ( flags )
+ {
+ case wxDateTime::Name_Full:
+ return 0;
+
+ case wxDateTime::Name_Abbr:
+ return 1;
+
+ default:
+ wxFAIL_MSG( "unknown wxDateTime::NameFlags value" );
+ }
+
+ return -1;
+}
+
+} // anonymous namespace
+
+/* static */
+wxString wxDateTime::GetEnglishMonthName(Month month, NameFlags flags)
+{
+ wxCHECK_MSG( month != Inv_Month, wxEmptyString, "invalid month" );
+
+ static const char *const monthNames[2][MONTHS_IN_YEAR] =
+ {
+ { "January", "February", "March", "April", "May", "June",
+ "July", "August", "September", "October", "November", "December" },
+ { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }
+ };
+
+ const int idx = NameArrayIndexFromFlag(flags);
+ if ( idx == -1 )
+ return wxString();
+
+ return monthNames[idx][month];
+}
+