asm: update NewYear to nullable value

This commit is contained in:
Lacoi 2023-11-04 12:38:53 +01:00
parent 70ed633bc0
commit a14ee7c108
4 changed files with 32 additions and 33 deletions

View file

@ -23,17 +23,16 @@ namespace ServerManagerTool.Common.ValidationRules
return new ValidationResult(false, "Invalid Date. Date must be formatted as yyyy.mm.dd hh:mm:ss");
}
if (datetime.ToUniversalTime() <= MinUnixDate)
if (datetime.ToUniversalTime() < MinUnixDate)
{
return new ValidationResult(false, $"Invalid Date. The Date must be after {MinUnixDate.ToLocalTime().ToString("yyyy.MM.dd HH:mm:ss")}");
}
if (datetime.ToUniversalTime() >= MaxUnixDate)
if (datetime.ToUniversalTime() > MaxUnixDate)
{
return new ValidationResult(false, $"Invalid Date. The Date must be before {MaxUnixDate.ToLocalTime().ToString("yyyy.MM.dd HH:mm:ss")}");
}
return new ValidationResult(true, null);
}
}