in Darabonba/Date.cs [122:144]
public int Diff(string unit, Date diffDate)
{
TimeSpan timeSpan = DateTime - diffDate.DateTime;
switch (unit.ToLowerInvariant())
{
case "millisecond":
return timeSpan.Milliseconds;
case "second":
return timeSpan.Seconds;
case "minute":
return timeSpan.Minutes;
case "hour":
return timeSpan.Hours;
case "day":
return timeSpan.Days;
case "month":
return timeSpan.Days / 30;
case "year":
return timeSpan.Days / 365;
default:
throw new ArgumentException("Unsupported unit.");
}
}