HandCoded.Finance.Date.Equals C# (CSharp) Method

Equals() public method

Determines if this Date instance and another hold the same date.
public Equals ( Date other ) : bool
other Date The Date instance to compare with.
return bool
        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 ()));
        }

Same methods

Date::Equals ( object other ) : bool

Usage Example

Exemplo n.º 1
0
 /// <summary>
 /// Determines if two <see cref="Date"/> values are different.
 /// </summary>
 /// <param name="lhs">The <see cref="Date"/> to compare.</param>
 /// <param name="rhs">The <see cref="Date"/> to compare to.</param>
 /// <returns><c>true</c> if the two <see cref="Date"/> values are different.</returns>
 public static bool NotEqual(Date lhs, Date rhs)
 {
     return (!lhs.Equals (rhs));
 }