Add date to compare date range

This commit is contained in:
Suphonchai Phoonsawat 2024-01-19 09:29:14 +07:00
parent 38db4ed802
commit 89d4d677de

View file

@ -14,7 +14,7 @@ namespace BMA.EHR.Domain.Extensions
public static int DiffDay(this DateTime startDate, DateTime endDate)
{
if (endDate < startDate)
if (endDate.Date < startDate.Date)
{
throw new ArgumentException("End Date must greater than start date.");
}