operator == method

  1. @override
bool operator ==(
  1. dynamic other
)
override

Returns true if other is a JDate at the same moment and in the same time zone (UTC or local).

var dDayUtc = new JDate.utc(1944, 6, 6);
var dDayLocal = dDayUtc.toLocal();

// These two dates are at the same moment, but are in different zones.
assert(dDayUtc != dDayLocal);

See isAtSameMomentAs for a comparison that compares moments in time independently of their zones.

Implementation

@override
bool operator ==(dynamic other) =>
    (other is JDate && _timeZoneOffset == other.timeZoneOffset)
        ? isJs
            ? (_millisecondsSinceEpoch == other.millisecondsSinceEpoch)
            : (_microsecondsSinceEpoch == other.microsecondsSinceEpoch)
        : false;