public static string ConvertTimexToStringRelative(TimexProperty timex, DateObject date)
        {
            var types = timex.Types.Count != 0 ? timex.Types : TimexInference.Infer(timex);

            if (types.Contains(Constants.TimexTypes.DateTimeRange))
            {
                return(ConvertDateTimeRange(timex, date));
            }

            if (types.Contains(Constants.TimexTypes.DateRange))
            {
                return(ConvertDateRange(timex, date));
            }

            if (types.Contains(Constants.TimexTypes.DateTime))
            {
                return(ConvertDateTime(timex, date));
            }

            if (types.Contains(Constants.TimexTypes.Date))
            {
                return(ConvertDate(timex, date));
            }

            return(TimexConvert.ConvertTimexToString(timex));
        }
Exemplo n.º 2
0
 public override string ToString()
 {
     return(TimexConvert.ConvertTimexToString(this));
 }