public string ToString(string dateFormat) { if (Start == null || End == null) { return(""); } return(RangeConverter <DateTime> .Join(Start.Value.ToString(dateFormat), End.Value.ToString(dateFormat))); }
public string ToIsoDateString() { if (Start == null || End == null) { return(string.Empty); } return(RangeConverter <DateTime> .Join(Start.ToIsoDateString(), End.ToIsoDateString())); }
public string ToString(Converter <DateTime?, string> converter) { if (Start == null || End == null) { return(string.Empty); } return(RangeConverter <DateTime> .Join(converter.Set(Start.Value), converter.Set(End.Value))); }
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 value, out DateRange date) { date = null; if (!RangeConverter <DateTime> .Split(value, out string start, out string end)) { return(false); } if (!DateTime.TryParse(start, out DateTime startDate)) { return(false); } if (!DateTime.TryParse(end, out DateTime endDate)) { return(false); } date = new DateRange(startDate, endDate); return(true); }
public MudRangeInput() { Value = new Range <T>(); Converter = new RangeConverter <T>(); }
public string ToIsoDateString() { return(RangeConverter <DateTime> .Join(Start.ToIsoDateString(), End.ToIsoDateString())); }