/** * @param HammerTime $otherDate * @return bool */ public function isSameDate(HammerTime $otherDate) { return $this->copy()->startOfDay()->eq($otherDate->copy()->startOfDay()); }
/** * Returns date to compare dates with. * The first and second are equal, the third isn't (but after the first). * * @return array */ public function sameDatesProvider() { return [[HammerTime::create(2014, 2, 3, 12, 45, 3), HammerTime::create(2014, 2, 3, 12, 45, 3), HammerTime::create(2014, 2, 4, 12, 45, 3)], [HammerTime::create(2014, 2, 3), HammerTime::create(2014, 2, 3), HammerTime::create(2014, 3, 5)]]; }