I've been messing around with this for a long time and I couldn't find out what code path doesn't return a value. I'm trying to check if an entered date is later than the current date. I'd thank you if you can help me out with this problem. (Date is a class and the brackets are me testing it out with an example.)
public bool IsLater(Date d)
{ //Date d = 2020/4/25 Date = 2020/4/21
if (d.year > year) //false
{
return true;
}
if (d.year < year) //false
{
return false;
}
if (d.year == year)//true
{
if (d.month > month)//false
{
return true;
}
if (d.month < month)//false
{
return false;
}
if (d.month == month)//true
{
if (d.day > day)//true
{
return true;//ok
}
if (d.day < day)
{
return false;
}
else if (d.day == day)
return false;
}
}
}
return d.Date > new DateTime(year, month, day);?