handle locales where AM/PM strings are empty
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1330,6 +1330,13 @@ wxDateTime::ParseFormat(const wxString& date,
|
|||||||
{
|
{
|
||||||
wxString am, pm, token = GetAlphaToken(input);
|
wxString am, pm, token = GetAlphaToken(input);
|
||||||
|
|
||||||
|
// some locales have empty AM/PM tokens and thus when formatting
|
||||||
|
// dates with the %p specifier mpthomg os gemerated; when trying to
|
||||||
|
// parse them back, we get an empty token here... but that's not
|
||||||
|
// an error.
|
||||||
|
if (token.empty())
|
||||||
|
break;
|
||||||
|
|
||||||
GetAmPmStrings(&am, &pm);
|
GetAmPmStrings(&am, &pm);
|
||||||
if (am.empty() && pm.empty())
|
if (am.empty() && pm.empty())
|
||||||
return NULL; // no am/pm strings defined
|
return NULL; // no am/pm strings defined
|
||||||
|
Reference in New Issue
Block a user