2022-07-24 12:35:00 -07:00

17 lines
1.0 KiB
C#

namespace View_by_Distance.Shared.Models.Stateless.Methods;
internal abstract class PersonBirthday
{
internal static DateTime GetDefaultValue() => DateTime.MinValue; // {{1}}SingletonValue
// ...
internal static string GetFormat() => "yyyy-MM-dd_HH";
internal static Models.PersonBirthday GetNextBirthDate(Properties.IStorage storage) => throw new Exception(storage.ToString()); // Person.GetNextBirthDate(storage);
internal static string GetFormatted(Models.PersonBirthday personBirthday) => personBirthday.Value.ToString(GetFormat());
internal static string GetFileName(Models.PersonBirthday personBirthday) => $"{personBirthday.Value.ToString(GetFormat())}.json";
internal static bool DoesBirthDateExits(Properties.IStorage storage, Models.PersonBirthday personBirthday) => File.Exists(GetFileFullName(storage, personBirthday));
internal static string GetFileFullName(Properties.IStorage storage, Models.PersonBirthday personBirthday) => Path.Combine(storage.PeopleRootDirectory, "{}", GetFileName(personBirthday));
}