Clarify wxDateTime::ParseDateTime() semantics: it needs both date and time.

Correct documentation and also remove unnecessary initialization of variables
and comments in the function itself.

See #11846.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-03-22 22:56:17 +00:00
parent b66a68884d
commit 7633bfcd68
2 changed files with 7 additions and 6 deletions

View File

@@ -59,7 +59,7 @@
in 'free' format, i.e. allow them to be specified in any of possible ways.
These functions will usually be used to parse the (interactive) user input
which is not bound to be in any predefined format. As an example,
ParseDateTime() can parse the strings such as "tomorrow", "March first" and
ParseDate() can parse the strings such as "tomorrow", "March first" and
even "next Sunday".
Finally notice that each of the parsing functions is available in several
@@ -821,7 +821,9 @@ public:
This function tries as hard as it can to interpret the given string as
date and time. Unlike ParseRfc822Date(), it will accept anything that
may be accepted and will only reject strings which can not be parsed in
any way at all.
any way at all. Notice that the function will fail if either date or
time part is present but not both, use ParseDate() or ParseTime() to
parse strings containing just the date or time component.
See ParseFormat() for the description of function parameters and return
value.

View File

@@ -1497,10 +1497,9 @@ wxDateTime::ParseDateTime(const wxString& date, wxString::const_iterator *end)
{
wxCHECK_MSG( end, false, "end iterator pointer must be specified" );
// Set to current day and hour, so strings like '14:00' becomes today at
// 14, not some other random date
wxDateTime dtDate = wxDateTime::Today();
wxDateTime dtTime = wxDateTime::Today();
wxDateTime
dtDate,
dtTime;
wxString::const_iterator
endTime,