Internationalization IntlCalendar::getMinimalDaysInFirstWeek
IntlCalendar::getMinimalDaysInFirstWeek
(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL >= 3.0.0a1)
IntlCalendar::getMinimalDaysInFirstWeek — 1년 또는 월의 첫 번째 주가 가질 수 있는 최소 일수를 가져옵니다.
설명
객체 지향 스타일
public IntlCalendar::getMinimalDaysInFirstWeek(): int|false
절차적 스타일
intlcal_get_minimal_days_in_first_week(IntlCalendar $calendar
): int|false
연도 또는 월의 첫 번째 주가 새해 또는 월에 있어야 하는 가장 작은 일수를 반환합니다. 예를 들어, 그레고리력에서 이 값이 1이면 연도의 첫 번째 주는 반드시 1월 1일을 포함하고, 이 값이 7이면 1월 1일이 있는 주는 다음 경우에만 해당 연도의 첫 번째 주가 됩니다. 1월 1일의 요일은 IntlCalendar::getFirstDayOfWeek()에서 반환된 요일과 일치합니다. 그렇지 않으면 전년도의 마지막 주가 됩니다.
매개변수
calendar
- IntlCalendar 인스턴스입니다.
반환 값
일 수를 나타내는 int 또는 실패 시 false
입니다.
Examples
예제 #1 IntlCalendar::getMinimalDaysInFirstWeek()
<?php
ini_set('date.timezone', 'UTC');
ini_set('intl.default_locale', 'en_US');
$cal = new IntlGregorianCalendar(2013, 0 /* January */, 2);
var_dump(IntlDateFormatter::formatObject($cal, 'cccc')); // Wednesday
var_dump($cal->getMinimalDaysInFirstWeek(), // 1
$cal->getFirstDayofWeek()); // 1 (Sunday)
// Week 1 of 2013
var_dump(IntlDateFormatter::formatObject($cal, "'Week 'w' of 'Y"));
$cal->setMinimalDaysInFirstWeek(4);
// Still Week 1 of 2013 (1st week has 5 days in the new year)
var_dump(IntlDateFormatter::formatObject($cal, "'Week 'w' of 'Y"));
$cal->setMinimalDaysInFirstWeek(6);
// Week 53 of 2012
var_dump(IntlDateFormatter::formatObject($cal, "'Week 'w' of 'Y"));
위의 예는 다음을 출력합니다.
string(9) "Wednesday" int(1) int(1) string(14) "Week 1 of 2013" string(14) "Week 1 of 2013" string(15) "Week 53 of 2012"