Approximate Years Fix
This commit is contained in:
Distance/Models
Property/Models
Shared/Models
Properties
Stateless
Tests
@ -70,7 +70,7 @@ internal abstract class PersonContainer
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string? VerifyAge(char numberSign, string personDisplayDirectory, string minusOne, string personDisplayDirectoryName, int? approximateYears, List<(string PersonKeyFormatted, Models.PersonBirthday PersonBirthday)> collection)
|
||||
internal static string? VerifyAge(char numberSign, string personDisplayDirectory, string? minusOne, string personDisplayDirectoryName, int? approximateYears, List<(string PersonKeyFormatted, Models.PersonBirthday PersonBirthday)> collection)
|
||||
{
|
||||
string? result;
|
||||
if (approximateYears is null)
|
||||
@ -82,13 +82,13 @@ internal abstract class PersonContainer
|
||||
DateTime dateTime = DateTime.Now;
|
||||
Models.PersonBirthday[] orderedPersonBirthdays = (from l in collection where !l.PersonKeyFormatted.Contains(numberSign) orderby l.PersonBirthday.Value.Ticks descending select l.PersonBirthday).ToArray();
|
||||
TimeSpan timeSpan = new(orderedPersonBirthdays[zero].Value.Ticks - dateTime.AddYears(-approximateYears.Value).Ticks);
|
||||
if (timeSpan.TotalDays < -356)
|
||||
if (timeSpan.TotalDays < -366)
|
||||
updateApproximateYears = approximateYears.Value + 1;
|
||||
else if (timeSpan.TotalDays > 356)
|
||||
else if (timeSpan.TotalDays > 1)
|
||||
updateApproximateYears = approximateYears.Value - 1;
|
||||
else
|
||||
updateApproximateYears = null;
|
||||
if (updateApproximateYears is null)
|
||||
if (minusOne is null || updateApproximateYears is null)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user