Lines Matching refs:this
87 $this->minimum_julian_day = $date;
88 $this->maximum_julian_day = $date;
89 [$this->year, $this->month, $this->day] = $this->calendar->jdToYmd($date);
96 $this->day = (int) $date[2];
97 $this->month = static::MONTH_TO_NUMBER[$date[1]] ?? 0;
99 if ($this->month === 0) {
100 $this->day = 0;
103 $this->year = $this->extractYear($date[0]);
106 …if ($this->month === 6 && $this->calendar instanceof JewishCalendar && !$this->calendar->isLeapYea…
107 $this->month = 7;
110 $this->setJdFromYmd();
116 $this->minimum_julian_day = $date->minimum_julian_day;
117 $this->maximum_julian_day = $date->maximum_julian_day;
120 if (get_class($this) === get_class($date)) {
121 $this->year = $date->year;
122 $this->month = $date->month;
123 $this->day = $date->day;
129 if (!$this->inValidRange()) {
130 $this->year = 0;
131 $this->month = 0;
132 $this->day = 0;
146 [$this->year, $this->month, $this->day] = $this->calendar->jdToYmd($jd);
149 $this->year = 0;
152 $this->month = 0;
155 $this->day = 0;
157 $this->setJdFromYmd();
165 return $this->maximum_julian_day;
173 return $this->year;
181 return $this->month;
189 return $this->day;
197 return $this->minimum_julian_day;
207 return $this->calendar->isLeapYear($this->year);
217 if ($this->year === 0) {
218 $this->minimum_julian_day = 0;
219 $this->maximum_julian_day = 0;
220 } elseif ($this->month === 0) {
221 $this->minimum_julian_day = $this->calendar->ymdToJd($this->year, 1, 1);
222 … $this->maximum_julian_day = $this->calendar->ymdToJd($this->nextYear($this->year), 1, 1) - 1;
223 } elseif ($this->day === 0) {
224 [$ny, $nm] = $this->nextMonth();
225 $this->minimum_julian_day = $this->calendar->ymdToJd($this->year, $this->month, 1);
226 $this->maximum_julian_day = $this->calendar->ymdToJd($ny, $nm, 1) - 1;
228 … $this->minimum_julian_day = $this->calendar->ymdToJd($this->year, $this->month, $this->day);
229 $this->maximum_julian_day = $this->minimum_julian_day;
350 if ($this->year === 0 || $date->year === 0) {
355 if (self::compare($this, $date) === 0) {
360 [$year1, $month1, $day1] = $this->calendar->jdToYmd($this->minimum_julian_day);
361 [$year2, $month2, $day2] = $this->calendar->jdToYmd($date->minimum_julian_day);
368 $days += $this->calendar->daysInMonth($year1, $month1);
373 $months += $this->calendar->monthsInYear($year2);
391 return new GregorianDate($this);
393 return new JulianDate($this);
395 return new JewishDate($this);
397 return new FrenchDate($this);
399 return new HijriDate($this);
401 return new JalaliDate($this);
403 return $this;
414 …return $this->minimum_julian_day >= $this->calendar->jdStart() && $this->maximum_julian_day <= $th…
424 return $this->calendar->monthsInYear();
435 return $this->calendar->daysInMonth($this->year, $this->month);
450 return $this->calendar->daysInWeek();
469 if ($this->day === 0) {
472 if ($this->month === 0) {
475 if ($this->year === 0) {
480 if ($this->day !== 0 && preg_match('/%[djlDNSwz]/', $format)) {
509 $format = strtr($format, ['%d' => $this->formatDayZeros()]);
512 $format = strtr($format, ['%j' => $this->formatDay()]);
515 $format = strtr($format, ['%l' => $this->formatLongWeekday()]);
518 $format = strtr($format, ['%D' => $this->formatShortWeekday()]);
521 $format = strtr($format, ['%N' => $this->formatIsoWeekday()]);
524 $format = strtr($format, ['%w' => $this->formatNumericWeekday()]);
527 $format = strtr($format, ['%z' => $this->formatDayOfYear()]);
530 $format = strtr($format, ['%F' => $this->formatLongMonth($case)]);
533 $format = strtr($format, ['%m' => $this->formatMonthZeros()]);
536 $format = strtr($format, ['%M' => $this->formatShortMonth()]);
539 $format = strtr($format, ['%n' => $this->formatMonth()]);
542 $format = strtr($format, ['%t' => (string) $this->daysInMonth()]);
545 $format = strtr($format, ['%L' => $this->isLeapYear() ? '1' : '0']);
548 $format = strtr($format, ['%Y' => $this->formatLongYear()]);
551 $format = strtr($format, ['%y' => $this->formatShortYear()]);
555 $format = strtr($format, ['%@' => $this->formatGedcomCalendarEscape()]);
558 $format = strtr($format, ['%A' => $this->formatGedcomDay()]);
561 $format = strtr($format, ['%O' => $this->formatGedcomMonth()]);
564 $format = strtr($format, ['%E' => $this->formatGedcomYear()]);
577 if ($this->day > 9) {
578 return I18N::digits($this->day);
581 return I18N::digits('0' . $this->day);
591 return I18N::digits($this->day);
601 return $this->dayNames($this->minimum_julian_day % $this->calendar->daysInWeek());
611 … return $this->dayNamesAbbreviated($this->minimum_julian_day % $this->calendar->daysInWeek());
621 return I18N::digits($this->minimum_julian_day % 7 + 1);
631 return I18N::digits(($this->minimum_julian_day + 1) % $this->calendar->daysInWeek());
641 … return I18N::digits($this->minimum_julian_day - $this->calendar->ymdToJd($this->year, 1, 1));
651 return I18N::digits($this->month);
661 if ($this->month > 9) {
662 return I18N::digits($this->month);
665 return I18N::digits('0' . $this->month);
679 return $this->monthNameGenitiveCase($this->month, $this->isLeapYear());
681 return $this->monthNameNominativeCase($this->month, $this->isLeapYear());
683 return $this->monthNameLocativeCase($this->month, $this->isLeapYear());
685 return $this->monthNameInstrumentalCase($this->month, $this->isLeapYear());
748 return $this->monthNameAbbreviated($this->month, $this->isLeapYear());
760 return $this->formatLongYear();
770 if ($this->day === 0) {
774 return sprintf('%02d', $this->day);
785 …if ($this->month === 7 && $this->calendar instanceof JewishCalendar && !$this->calendar->isLeapYea…
789 return static::NUMBER_TO_MONTH[$this->month] ?? '';
799 if ($this->year === 0) {
803 return sprintf('%04d', $this->year);
823 return I18N::digits($this->year);
834 … $this->month === $this->calendar->monthsInYear() ? $this->nextYear($this->year) : $this->year,
835 $this->month % $this->calendar->monthsInYear() + 1,
846 return $this->calendar->jdToYmd(Registry::timestampFactory()->now()->julianDay());
856 $tmp = clone $this;
876 if ($this->day !== 0 && strpbrk($date_format, 'dDj')) {
879 } elseif ($this->month !== 0 && strpbrk($date_format, 'FMmn')) {
888 'cal' => $this->calendar->gedcomCalendarEscape(),
889 'year' => $this->formatGedcomYear(),
890 'month' => $this->formatGedcomMonth(),
891 'day' => $this->formatGedcomDay(),