20 lines
366 B
C#
20 lines
366 B
C#
|
|
namespace TrueCV.Application.Helpers;
|
||
|
|
|
||
|
|
public static class DateHelpers
|
||
|
|
{
|
||
|
|
public static DateOnly? ParseDate(string? dateString)
|
||
|
|
{
|
||
|
|
if (string.IsNullOrWhiteSpace(dateString))
|
||
|
|
{
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (DateOnly.TryParse(dateString, out var date))
|
||
|
|
{
|
||
|
|
return date;
|
||
|
|
}
|
||
|
|
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
}
|