private static string ConvertDate(TimexProperty timex, DateObject date) { if (timex.Year != null && timex.Month != null && timex.DayOfMonth != null) { var timexDate = new DateObject(timex.Year.Value, timex.Month.Value, timex.DayOfMonth.Value); if (TimexDateHelpers.DatePartEquals(timexDate, date)) { return("today"); } var tomorrow = TimexDateHelpers.Tomorrow(date); if (TimexDateHelpers.DatePartEquals(timexDate, tomorrow)) { return("tomorrow"); } var yesterday = TimexDateHelpers.Yesterday(date); if (TimexDateHelpers.DatePartEquals(timexDate, yesterday)) { return("yesterday"); } if (TimexDateHelpers.IsThisWeek(timexDate, date)) { return($"this {GetDateDay(timexDate.DayOfWeek)}"); } if (TimexDateHelpers.IsNextWeek(timexDate, date)) { return($"next {GetDateDay(timexDate.DayOfWeek)}"); } if (TimexDateHelpers.IsLastWeek(timexDate, date)) { return($"last {GetDateDay(timexDate.DayOfWeek)}"); } } return(TimexConvertEnglish.ConvertDate(timex)); }