/// <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(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())); } }
/// <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(Date other) { if ((timeZone == null) && (other.timeZone == null)) { return(dateValue.Equals(other.dateValue)); } else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals(other.timeZone)) { return(dateValue.Equals(other.dateValue)); } else { return(ToDateTime().Equals(other.ToDateTime())); } }
/// <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(Date other) { if ((timeZone == null) && (other.timeZone == null)) return (dateValue.Equals (other.dateValue)); else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals (other.timeZone)) return (dateValue.Equals (other.dateValue)); else return (ToDateTime ().Equals (other.ToDateTime ())); }
/// <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(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 ())); }