System.DateTimeExtensions.HumanFormat C# (CSharp) Méthode

HumanFormat() public static méthode

public static HumanFormat ( this dateTime ) : IFormattedMessage
dateTime this
Résultat 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;
		}