namespace RealCV.Application.Helpers; public static class DateHelpers { /// /// Calculates the number of months between two dates. /// public static int MonthsBetween(DateOnly start, DateOnly end) { return ((end.Year - start.Year) * 12) + (end.Month - start.Month); } /// /// Calculates the number of months between two dates. /// public static int MonthsBetween(DateTime start, DateTime end) { return ((end.Year - start.Year) * 12) + (end.Month - start.Month); } public static DateOnly? ParseDate(string? dateString) { if (string.IsNullOrWhiteSpace(dateString)) { return null; } if (DateOnly.TryParse(dateString, out var date)) { return date; } return null; } }