Refactor wxGridCellDateRenderer::Parse() to make it reusable

No real changes, just create TryParseDate() helper in order to allow
reusing it from wxGridCellDateEditor too in the upcoming commit.
This commit is contained in:
Vadim Zeitlin
2020-11-03 02:50:31 +01:00
parent eda11b8755
commit 56ec476a3a
2 changed files with 33 additions and 10 deletions

View File

@@ -1084,5 +1084,20 @@ wxGetContentRect(wxSize contentSize,
int hAlign,
int vAlign);
namespace wxGridPrivate
{
#if wxUSE_DATETIME
// Helper function trying to parse the given string using the specified date
// format and then using ParseDate() as a fallback if it failed. If this still
// fails, returns false.
bool
TryParseDate(wxDateTime& result, const wxString& text, const wxString& format);
#endif // wxUSE_DATETIME
} // namespace wxGridPrivate
#endif // wxUSE_GRID
#endif // _WX_GENERIC_GRID_PRIVATE_H_