Return true if the given Date is on the same day as Easter
775181
@Override
    public boolean isOn(Date date)
    {
        synchronized(calendar) {
            calendar.setTime(date);
            int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR);

            calendar.setTime(computeInYear(calendar.getTime(), calendar));

            return calendar.get(Calendar.DAY_OF_YEAR) == dayOfYear;
        }
    }
1184604
public boolean isSameDay(Calendar calendar) {
		Calendar c1 = asCalendar();
		return (c1.get(Calendar.ERA) == calendar.get(Calendar.ERA) &&
				c1.get(Calendar.YEAR) == calendar.get(Calendar.YEAR) &&
				c1.get(Calendar.DAY_OF_YEAR) == calendar.get(Calendar.DAY_OF_YEAR));
	}
409539
def easter(year)
      golden_number = (year % 19) + 1
      
      if year <= 1752 then
        # Julian calendar
        dominical_number = (year + (year / 4) + 5) % 7
        paschal_full_moon = (3 - (11 * golden_number) - 7) % 30
      else
        # Gregorian calendar
        dominical_number = (year + (year / 4) - (year / 100) + (year / 400)) % 7
        solar_correction = (year - 1600) / 100 - (year - 1600) / 400
        lunar_correction = (((year - 1400) / 100) * 8) / 25
        paschal_full_moon = (3 - 11 * golden_number + solar_correction - lunar_correction) % 30
      end

      dominical_number += 7 until dominical_number > 0 
      
      paschal_full_moon += 30 until paschal_full_moon > 0 
      paschal_full_moon -= 1 if paschal_full_moon == 29 or (paschal_full_moon == 28 and golden_number > 11)
      
      difference = (4 - paschal_full_moon - dominical_number) % 7
      difference += 7 if difference < 0 
      
      day_easter = paschal_full_moon + difference + 1
      
      day_easter < 11 ? new(year, 3, day_easter + 21) : new(year, 4, day_easter - 10)
    end
499328
def chk_date_arg(s):
    """"""
    if re_date.search(s) is None:
        return False
    comp = s.split('-')
    try:
        dt = datetime.date(int(comp[0]), int(comp[1]), int(comp[2]))
        return True
    except Exception as e:
        return False
1153224
def get_good_friday(self, year):
        ""
        sunday = self.get_easter_sunday(year)
        return sunday - timedelta(days=2)
376948
public boolean isAfter(Day day)
  {
    if (day == null)
      throw new IllegalArgumentException("day cannot be null");

    return localDate.isAfter(day.localDate);
  }
872146
def get_spring_holiday(self, year):
        
        easter = self.get_easter_monday(year)
        spring_holiday = self.get_nth_weekday_in_month(year, 4, MON, 3)
        if easter == spring_holiday:
            spring_holiday = self.get_nth_weekday_in_month(
                year, 4, MON, 2)

        return (spring_holiday, self.spring_holiday_label)
1213206
public static boolean isLastDayOfTheMonth(final Date date) {

    Date dateOfMonthsBack = getDateOfMonthsBack(-1, date);
    int dayOfMonth = getDayOfMonth(dateOfMonthsBack);
    Date dateOfDaysBack = getDateOfDaysBack(dayOfMonth, dateOfMonthsBack);
    return dateOfDaysBack.equals(date);
  }
1179788
def _occursOn(self, myDate):
        
        # TODO analyse which is faster (rrule or db) and test that first
        if myDate not in self.repeat:
            return False
        if CancellationPage.events.child_of(self)                            \
                           .filter(except_date=myDate).exists():
            return False
        return True
608521
private static function dateIsTargetDay(\DateTime $date)
    {
        // $date is a saturday or sunday?
        if($date->format('N') === '6' || $date->format('N') === '7')
            return false;

        $day = $date->format('m-d');
        if($day === '01-01'             // new year's day
            || $day === '05-01'         // labour day
            || $day === '12-25'         // first christmas day
            || $day === '12-26')        // second christmas day
            return false;

        $year = $date->format('Y');
        $easter = easterDate((int) $year);      // contains easter sunday
        $goodFriday =   $easter->modify('-2 days')->format('m-d');      // $easter contains now good friday
        $easterMonday = $easter->modify('+3 days')->format('m-d');      // $easter contains now easter monday

        if($day === $goodFriday || $day === $easterMonday)
            return false;

        return true;
    }
139317
def occurs_on?(date)
      date = TimeUtil.ensure_date(date)
      begin_time = TimeUtil.beginning_of_date(date, start_time)
      closing_time = TimeUtil.end_of_date(date, start_time)
      occurs_between?(begin_time, closing_time)
    end
898764
public function getEasterDate()
    {
        $easter = new \DateTime($this->getYear() . '-03-21');
        $days   = easter_days($this->getYear());

        return $easter->add(new DateInterval('P' . $days . 'D'));
    }
624580
public static boolean isToday(Date time) {
        String now = getFormatDate(SHORT);
        String target = getFormatDate(SHORT, time);
        return now.equals(target);
    }
452543
def onOffset(self, date):
        """"""
        mod_month = (date.month - self.month) % 3
        return mod_month == 0 and date.day == self._get_offset_day(date)
1208308
def date_match?(zt)

      return false unless sub_match?(zt, :day, @days)
      return false unless sub_match?(zt, :month, @months)

      return true if (
      (@weekdays && @monthdays) &&
        (sub_match?(zt, :wday, @weekdays) ||
          sub_match?(zt, :monthdays, @monthdays)))

      return false unless sub_match?(zt, :wday, @weekdays)
      return false unless sub_match?(zt, :monthdays, @monthdays)

      true
    end
1250870
private static Date rollGetDate(Calendar calendar, int days) {
		Calendar easterSunday = (Calendar) calendar.clone();
		easterSunday.add(Calendar.DATE, days);
		return easterSunday.getTime();
	}
526437
public static boolean isOverlay(Date date1Start, Date date1End, Date date2Start, Date date2End) {
        return ((date1Start.getTime() >= date2Start.getTime()) && date1Start.getTime() <= date2End.getTime()) ||
                   ((date2Start.getTime() >= date1Start.getTime()) && date2Start.getTime() <= date1End.getTime());
    }