From 8aa25f40256648a6770b6fa0e980801acea5e614 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sat, 21 Mar 2009 00:19:27 +0000 Subject: [PATCH] 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 --- src/common/datetimefmt.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp index 98c70a6cd1..57c2312465 100644 --- a/src/common/datetimefmt.cpp +++ b/src/common/datetimefmt.cpp @@ -1329,6 +1329,13 @@ wxDateTime::ParseFormat(const wxString& date, case _T('p'): // AM or PM string { 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); if (am.empty() && pm.empty()) -- 2.45.2