System.DateTimeExtensions.HumanFormat C# (CSharp) Метод

HumanFormat() публичный статический Метод

public static HumanFormat ( this dateTime ) : IFormattedMessage
dateTime this
Результат IFormattedMessage
		public static IFormattedMessage HumanFormat(this DateTime? dateTime)
		{
			if (dateTime != null)
			{
				if (dateTime.Value == MinDateValue)
					return Past;
				if (dateTime.Value == MaxDateValue)
					return Future;

				var date = dateTime.Value.ToString("MMM d");
				return dateTime.Value.Date == CurrentDate.Value.Date
					? "Today ({date})".Localize(new { date })
					: date.AsLocalized();
			}
			return NoDate;
		}