private static Boolean GetDayOfNN(ref DateTimeResult result, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) {
if ((result.flags & ParseFlags.HaveDate) != 0) {
// Multiple dates in the input string
result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
return false;
}
int n1 = raw.GetNumber(0);
int n2 = raw.GetNumber(1);
int year = result.calendar.GetYear(DateTime.Now);
int order;
if (!GetMonthDayOrder(dtfi.MonthDayPattern, dtfi, out order)) {
result.SetFailure(ParseFailureKind.FormatWithParameter, "Format_BadDatePattern", dtfi.MonthDayPattern);
return false;
}
if (order == ORDER_MD)
{
if (SetDateYMD(ref result, year, n1, n2)) // MD
{
result.flags |= ParseFlags.HaveDate;
return true;
}
} else {
// ORDER_DM
if (SetDateYMD(ref result, year, n2, n1)) // DM
{
result.flags |= ParseFlags.HaveDate;
return true;
}
}
result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
return false;
}