/// <summary> /// Determines if this <b>Date</b> instance and another hold the same /// date. /// </summary> /// <param name="other">The <b>Date</b> instance to compare with.</param> /// <returns><c>true</c> if both instance represent the same date, /// <c>false</c> otherwise.</returns> public bool Equals(DateTime other) { DateTime lhs = Normalize(); DateTime rhs = other.Normalize(); return(lhs.dateValue.Equals(rhs.dateValue) && lhs.timeValue.Equals(rhs.timeValue)); }
/// <summary> /// Returns the result of comparing this instance to another <b>Date</b>. /// </summary> /// <param name="other">The <b>Date</b> instance to compare with.</param> /// <returns>An integer value indicating the relative ordering.</returns> public int CompareTo(DateTime other) { DateTime lhs = Normalize(); DateTime rhs = other.Normalize(); int result = lhs.dateValue.CompareTo(rhs.dateValue); if (result != 0) { return(result); } return(lhs.timeValue.CompareTo(rhs.timeValue)); }
/// <summary> /// Determines if this <b>Date</b> instance and another hold the same /// date. /// </summary> /// <param name="other">The <b>Date</b> instance to compare with.</param> /// <returns><c>true</c> if both instance represent the same date, /// <c>false</c> otherwise.</returns> public bool Equals(DateTime other) { DateTime lhs = Normalize (); DateTime rhs = other.Normalize (); return (lhs.dateValue.Equals (rhs.dateValue) && lhs.timeValue.Equals (rhs.timeValue)); }
/// <summary> /// Returns the result of comparing this instance to another <b>Date</b>. /// </summary> /// <param name="other">The <b>Date</b> instance to compare with.</param> /// <returns>An integer value indicating the relative ordering.</returns> public int CompareTo(DateTime other) { DateTime lhs = Normalize (); DateTime rhs = other.Normalize (); int result = lhs.dateValue.CompareTo (rhs.dateValue); if (result != 0) return (result); return (lhs.timeValue.CompareTo (rhs.timeValue)); }