Moved more to Map library

This commit is contained in:
2022-08-29 08:45:01 -07:00
parent 674555b4fc
commit c1d30b5bbc
46 changed files with 1631 additions and 697 deletions

View File

@ -0,0 +1,22 @@
namespace View_by_Distance.Shared.Models.Stateless.Methods;
internal abstract class Age
{
internal static (int, TimeSpan) GetAge(DateTime minuend, DateTime subtrahend)
{
TimeSpan result;
int years = 0;
DateTime check = new(subtrahend.Ticks);
for (int i = 0; i < int.MaxValue; i++)
{
check = check.AddYears(1);
if (check > minuend)
break;
years += 1;
}
result = new(minuend.Ticks - check.AddYears(-1).Ticks);
return (years, result);
}
}