Gets the business day before the day number.

@param int $dayNumber

@return DayInterface|null
18636
private function getDayBefore($dayNumber)
    {
        $tmpDayNumber = $dayNumber;

        for ($i = 0; $i < 6; $i++) {
            $tmpDayNumber = (Days::MONDAY === $tmpDayNumber) ? Days::SUNDAY : --$tmpDayNumber;

            if (null !== $day = $this->getDay($tmpDayNumber)) {
                return $day;
            }
        }

        return $this->getDay($dayNumber);
    }
610485
public function getStatementDay()
    {
        if (null === $this->n) {
            $this->n = 1;
        }

        $date = new \DateTime($this->d, new \DateTimeZone('UTC'));

        $date->sub(new \DateInterval(sprintf('P%dD', ($this->p * $this->n) - 1)));
        $start_date = $date->format('Y-m-j');

        $date->add(new \DateInterval(sprintf('P%dD', $this->n)));
        $end_date = $date->format('Y-m-j');

        if (is_array($this->select)) {
            $query = sprintf('%s WHERE %s BETWEEN %s AND %s', $this->select[0], $this->c, $start_date, $end_date);
            $adt = $this->sql->getAdapter();
            $statement = $adt->query($query, $adt::QUERY_MODE_PREPARE);
        } else {
            $select = clone $this->select;
            $select->where(new Between($this->c, $start_date, $end_date));

            $statement = $this->sql->prepareStatementForSqlObject($select);
        }

        return $statement;
    }
1243932
protected function getDays() {
        if (!$this->_days) {
            $this->_days = new DayList($this->version, $this->solution['resourceType']);
        }

        return $this->_days;
    }
374628
public static double getJulianDayNumber(Calendar time) {

        if (time == null) {
            time = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"));
        }

        double jd = BASE_JD + time.getTimeInMillis() / MILLISEC_PER_DAY;

        return jd;
    }
682340
public function getCountForDay(Carbon $day = null, $locale = null, $query = null, $cacheKey = null)
    {
        if (is_null($day))
        {
            $day = Carbon::now();
        }

        return $this->getCountInBetween($day->startOfDay(), $day->copy()->endOfDay(), $locale, $query, $cacheKey);
    }
223926
private function createDefaultShipmentDate() {
		$now = time();
		$weekDay = date('w', $now);

		if($weekDay === 0)
			$now += 86400; // Increase Day by 1 if Sunday

		return date('Y-m-d', $now);
	}
69608
public function getHour($yearOrStart, $month = null, $day = null, $hour = null)
    {
        if (!$yearOrStart instanceof \DateTime) {
            $yearOrStart = new \DateTime(sprintf('%s-%s-%s %s:00', $yearOrStart, $month, $day, $hour));
        }

        return $this->getFactory()->createHour($yearOrStart);
    }
1136399
public static final BigInteger printDay(Day day)
   {
      return (day == null ? null : BigInteger.valueOf(day.getValue() - 1));
   }
1122166
public function getBirthday(){
		if(isset($this->_userInfo['birthday'])) {
			$this->_userInfo['birthday'] = str_replace('0000', date('Y'), $this->_userInfo['birthday']);
			$result = date('d.m.Y', strtotime($this->_userInfo['birthday']));
			}
		else {
			$result = null;
			}
		return $result;
		}
594886
public function getPage(int $pageNumber)
    {
        $pages = $this->getPages();

        if (isset($pages[$pageNumber - 1])) {
            return $pages[$pageNumber - 1];
        }

        return null;
    }
881519
public function getBeforeDay($days = 7,$eventTypeId = null)
    {
        $this->getByDays($days);

        if(!is_null($eventTypeId))
            $this->eventQuery->where('point_event_type_id' ,$eventTypeId);

        return $this->doQuery();
    }
196842
public final function setDay( int $day = null )
      : DateTime
   {

      if ( \is_null( $day ) )
      {
         $day = static::CurrentDay();
      }

      return $this->setDateParts( null, null, $day );

   }
807327
public function get_prev_day($daytimestamp) {
        $date = new \DateTime();
        $date->setTimestamp($daytimestamp);
        $date->modify('-1 day');

        return $date->getTimestamp();
    }
980842
public function get_next_day($daytimestamp) {
        $date = new \DateTime();
        $date->setTimestamp($daytimestamp);
        $date->modify('+1 day');

        return $date->getTimestamp();
    }
218900
public function getDateMonday($format = 'Y-m-d')
    {
        $weekDay = $this->format('N') - 1;
        $dateTime = clone $this;
        if ($weekDay) {
            $dateTime->add(sprintf('- %d days', $weekDay));
        }
        if ($format) {
            return $dateTime->format($format);
        }
        return $dateTime;
    }
915934
public function dayOfWeek()
    {
        $dateString = sprintf(
            '%04d-%02d-%02d',
            $this->month->getYear()->value(),
            $this->month->value(),
            $this->day
        );

        $datetime = new \DateTime($dateString);

        return (int) $datetime->format('N');
    }
530290
private function getDateBefore(\DateTime $date)
    {
        $tmpDate = clone $date;
        $tmpDate->modify('-1 day');

        $dayOfWeek = (int) $tmpDate->format('N');
        $closestDay = $this->getClosestDayBefore($dayOfWeek);

        if ($closestDay->getDayOfWeek() !== $dayOfWeek) {
            $tmpDate->modify(sprintf('last %s', Days::toString($closestDay->getDayOfWeek())));
        }

        return $tmpDate;
    }