예제 #1
0
        public string ToString(string dateFormat)
        {
            if (Start == null || End == null)
            {
                return("");
            }

            return(RangeConverter <DateTime> .Join(Start.Value.ToString(dateFormat), End.Value.ToString(dateFormat)));
        }
예제 #2
0
        public string ToIsoDateString()
        {
            if (Start == null || End == null)
            {
                return(string.Empty);
            }

            return(RangeConverter <DateTime> .Join(Start.ToIsoDateString(), End.ToIsoDateString()));
        }
예제 #3
0
        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)));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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);
        }
예제 #6
0
 public MudRangeInput()
 {
     Value     = new Range <T>();
     Converter = new RangeConverter <T>();
 }
예제 #7
0
 public string ToIsoDateString()
 {
     return(RangeConverter <DateTime> .Join(Start.ToIsoDateString(), End.ToIsoDateString()));
 }