Add wxGetUIDateFormat() helper function
Retrieve thr date format to use, even when wxUSE_INTL==0.
This commit is contained in:
@@ -67,6 +67,18 @@ private:
|
||||
wxDECLARE_NO_COPY_CLASS(wxUILocale);
|
||||
};
|
||||
|
||||
#endif // wxUSE_INTL
|
||||
inline wxString wxGetUIDateFormat()
|
||||
{
|
||||
return wxUILocale::GetCurrent().GetInfo(wxLOCALE_SHORT_DATE_FMT);
|
||||
}
|
||||
|
||||
#else // !wxUSE_INTL
|
||||
|
||||
inline wxString wxGetUIDateFormat()
|
||||
{
|
||||
return wxString(wxS("%x"));
|
||||
}
|
||||
|
||||
#endif // wxUSE_INTL/!wxUSE_INTL
|
||||
|
||||
#endif // _WX_UILOCALE_H_
|
||||
|
@@ -104,3 +104,18 @@ public:
|
||||
wxString GetInfo(wxLocaleInfo index,
|
||||
wxLocaleCategory cat = wxLOCALE_CAT_DEFAULT) const;
|
||||
};
|
||||
|
||||
/**
|
||||
Return the format to use for formatting user-visible dates.
|
||||
|
||||
This is a simple wrapper function normally calling wxUILocale::GetInfo()
|
||||
with wxLOCALE_SHORT_DATE_FMT argument, but which is also available when @c
|
||||
wxUSE_INTL==0, i.e. support for internationalization is disabled at
|
||||
compile-time, in which case it returns @c %x string, i.e. uses the current
|
||||
C locale formatting rather than UI locale.
|
||||
|
||||
@see wxDateTime::Format()
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
wxString wxGetUIDateFormat();
|
||||
|
Reference in New Issue
Block a user