]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datetime.cpp
don't annoy the user by repeating the question which had been already answered (and...
[wxWidgets.git] / src / common / datetime.cpp
index a38960ec0549885a302e92437965d9842755d93a..987c81218330e8e0477b4a18e59c0af064f151f2 100644 (file)
@@ -194,7 +194,11 @@ static const wxDateTime::wxDateTime_t gs_cumulatedDays[2][MONTHS_IN_YEAR] =
 
 // in the fine tradition of ANSI C we use our equivalent of (time_t)-1 to
 // indicate an invalid wxDateTime object
+#ifdef __WIN16__
+static const wxDateTime gs_dtDefault;
+#else
 static const wxDateTime gs_dtDefault = wxLongLong((long)ULONG_MAX, ULONG_MAX);
+#endif
 
 const wxDateTime& wxDefaultDateTime = gs_dtDefault;
 
@@ -3166,7 +3170,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
                     // but we already have a month - maybe we guessed wrong?
                     if ( !haveDay )
                     {
-                       // no need to check in month range as always < 12, but
+                        // no need to check in month range as always < 12, but
                         // the days are counted from 1 unlike the months
                         day = (wxDateTime_t)mon + 1;
                         haveDay = TRUE;
@@ -3176,7 +3180,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
                         // could possible be the year (doesn't the year come
                         // before the month in the japanese format?) (FIXME)
                         break;
-                       }
+                    }
                 }
 
                 mon = mon2;
@@ -3288,7 +3292,8 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
                 mon = (wxDateTime::Month)(day - 1);
 
                 // we're in the current year then
-                if ( year <= GetNumOfDaysInMonth(Inv_Year, mon) )
+                if ( (year > 0) &&
+                        (unsigned)year <= GetNumOfDaysInMonth(Inv_Year, mon) )
                 {
                     day = year;