public static bool TryParse(string value, Converter <DateTime?, string> converter, out DateRange date) { date = null; if (!RangeConverter <DateTime> .Split(value, out var start, out var end)) { return(false); } return(TryParse(start, end, converter, out date)); }
public static bool TryParse(string start, string end, Converter <DateTime?, string> converter, out DateRange date) { date = null; var endDate = converter.Get(end); if (converter.GetError) { return(false); } var startDate = converter.Get(start); if (converter.GetError) { return(false); } date = new DateRange(startDate, endDate); return(true); }
public bool Equals(DateRange other) => other != null && Start == other.Start && End == other.End;