public CompareTo ( Date other ) : int | ||
other | Date | The Date instance to compare with. |
return | int |
public int CompareTo(Date other)
{
if ((timeZone == null) && (other.timeZone == null))
return (dateValue.CompareTo (other.dateValue));
else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals (other.timeZone))
return (dateValue.CompareTo (other.dateValue));
else
return (ToDateTime ().CompareTo (other.ToDateTime ()));
}
Date::CompareTo ( Object other ) : int |
/// <summary> /// Compares two <see cref="Date"/> instances to determine if the /// first is equal to or smaller than the second. /// </summary> /// <param name="lhs">The first date.</param> /// <param name="rhs">The second date.</param> /// <returns><c>true</c> if the first value is less than the second.</returns> public static bool LessOrEqual(Date lhs, Date rhs) { return (lhs.CompareTo (rhs) <= 0); }