Exemple #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)));
        }
Exemple #2
0
        public string ToIsoDateString()
        {
            if (Start == null || End == null)
            {
                return(string.Empty);
            }

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