.github/ISSUE_TEMPLATE.md 0000644 00000002306 15014555553 0010622 0 ustar 00 Hello,
I encountered an issue with the following code:
```php
echo Carbon::parse('2018-06-01')->subDay()->month;
```
Carbon version: **PUT HERE YOUR COMPOSER CARBON VERSION**
PHP version: **PUT HERE YOUR PHP VERSION**
I expected to get:
```
6
```
But I actually get:
```
5
```
Thanks! LICENSE 0000644 00000002034 15014555553 0005560 0 ustar 00 Copyright (C) Brian Nesbitt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
composer.json 0000644 00000003010 15014555553 0007270 0 ustar 00 {
"name": "nesbot/carbon",
"type": "library",
"description": "A simple API extension for DateTime.",
"keywords": [
"date",
"time",
"DateTime"
],
"homepage": "http://carbon.nesbot.com",
"support": {
"issues": "https://github.com/briannesbitt/Carbon/issues",
"source": "https://github.com/briannesbitt/Carbon"
},
"license": "MIT",
"authors": [
{
"name": "Brian Nesbitt",
"email": "brian@nesbot.com",
"homepage": "http://nesbot.com"
}
],
"minimum-stability": "dev",
"require": {
"php": "^7.1.8",
"symfony/translation": "^4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.11",
"phpunit/phpunit": "^7.1.5"
},
"autoload": {
"psr-4": {
"": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"config": {
"process-timeout": 0,
"sort-packages": true
},
"scripts": {
"test": [
"@phpunit",
"@phpcs"
],
"phpunit": "phpunit --verbose --coverage-clover=coverage.xml",
"phpcs": "php-cs-fixer fix -v --diff --dry-run",
"phpstan": "phpstan analyse --configuration phpstan.neon --level 3 src tests",
"phpdoc": "php phpdoc.php"
},
"extra": {
"laravel": {
"providers": [
"Carbon\\Laravel\\ServiceProvider"
]
}
}
}
readme.md 0000644 00000005615 15014555553 0006342 0 ustar 00 # Carbon
[](https://packagist.org/packages/nesbot/carbon)
[](https://packagist.org/packages/nesbot/carbon)
[](https://packagist.org/packages/nesbot/carbon)
[](https://travis-ci.org/briannesbitt/Carbon)
[](https://styleci.io/repos/5724990)
[](https://codecov.io/github/briannesbitt/Carbon?branch=master)
[](https://php-eye.com/package/nesbot/carbon)
[](https://github.com/phpstan/phpstan)
A simple PHP API extension for DateTime. [http://carbon.nesbot.com](http://carbon.nesbot.com)
```php
use Carbon\Carbon;
printf("Right now is %s", Carbon::now()->toDateTimeString());
printf("Right now in Vancouver is %s", Carbon::now('America/Vancouver')); //implicit __toString()
$tomorrow = Carbon::now()->addDay();
$lastWeek = Carbon::now()->subWeek();
$nextSummerOlympics = Carbon::createFromDate(2016)->addYears(4);
$officialDate = Carbon::now()->toRfc2822String();
$howOldAmI = Carbon::createFromDate(1975, 5, 21)->age;
$noonTodayLondonTime = Carbon::createFromTime(12, 0, 0, 'Europe/London');
$internetWillBlowUpOn = Carbon::create(2038, 01, 19, 3, 14, 7, 'GMT');
// Don't really want this to happen so mock now
Carbon::setTestNow(Carbon::createFromDate(2000, 1, 1));
// comparisons are always done in UTC
if (Carbon::now()->gte($internetWillBlowUpOn)) {
die();
}
// Phew! Return to normal behaviour
Carbon::setTestNow();
if (Carbon::now()->isWeekend()) {
echo 'Party!';
}
echo Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago'
// ... but also does 'from now', 'after' and 'before'
// rolling up to seconds, minutes, hours, days, months, years
$daysSinceEpoch = Carbon::createFromTimestamp(0)->diffInDays();
```
## Installation
### With Composer
```
$ composer require nesbot/carbon
```
```json
{
"require": {
"nesbot/carbon": "^1.33"
}
}
```
```php
### Without Composer
Why are you not using [composer](http://getcomposer.org/)? Download [Carbon.php](https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Carbon.php) from the repo and save the file into your project path somewhere.
```php
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon;
use Carbon\Traits\Date;
use DateTime;
/**
* A simple API extension for DateTime.
*
*
*
* @property int $year
* @property int $yearIso
* @property int $month
* @property int $day
* @property int $hour
* @property int $minute
* @property int $second
* @property int $micro
* @property int $microsecond
* @property int $timestamp seconds since the Unix Epoch
* @property string $englishDayOfWeek the day of week in English
* @property string $shortEnglishDayOfWeek the abbreviated day of week in English
* @property string $englishMonth the day of week in English
* @property string $shortEnglishMonth the abbreviated day of week in English
* @property string $localeDayOfWeek the day of week in current locale LC_TIME
* @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME
* @property string $localeMonth the month in current locale LC_TIME
* @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME
* @property int $milliseconds
* @property int $millisecond
* @property int $milli
* @property int $week 1 through 53
* @property int $isoWeek 1 through 53
* @property int $weekYear year according to week format
* @property int $isoWeekYear year according to ISO week format
* @property int $dayOfYear 1 through 366
* @property int $age does a diffInYears() with default parameters
* @property int $offset the timezone offset in seconds from UTC
* @property int $offsetMinutes the timezone offset in minutes from UTC
* @property int $offsetHours the timezone offset in hours from UTC
* @property CarbonTimeZone $timezone the current timezone
* @property CarbonTimeZone $tz alias of $timezone
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
* @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday)
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
* @property-read int $daysInMonth number of days in the given month
* @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
* @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
* @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language
* @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language
* @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
* @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
* @property-read int $noZeroHour current hour from 1 to 24
* @property-read int $weeksInYear 51 through 53
* @property-read int $isoWeeksInYear 51 through 53
* @property-read int $weekOfMonth 1 through 5
* @property-read int $weekNumberInMonth 1 through 5
* @property-read int $firstWeekDay 0 through 6
* @property-read int $lastWeekDay 0 through 6
* @property-read int $daysInYear 365 or 366
* @property-read int $quarter the quarter of this instance, 1 - 4
* @property-read int $decade the decade of this instance
* @property-read int $century the century of this instance
* @property-read int $millennium the millennium of this instance
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
* @property-read string $timezoneName the current timezone name
* @property-read string $tzName alias of $timezoneName
* @property-read string $timezoneAbbreviatedName the current timezone abbreviated name
* @property-read string $tzAbbrName alias of $timezoneAbbreviatedName
* @property-read string $locale locale of the current instance
*
* @method string format($format) call \DateTime::format if mutable or \DateTimeImmutable::format else.
* http://php.net/manual/en/datetime.format.php
* @method static modify($modify) call \DateTime::modify if mutable or \DateTimeImmutable::modify else.
* http://php.net/manual/en/datetime.modify.php
* @method int getOffset() call \DateTime::getOffset if mutable or \DateTimeImmutable::getOffset else.
* http://php.net/manual/en/datetime.getoffset.php
* @method int getTimestamp() call \DateTime::getTimestamp if mutable or \DateTimeImmutable::getTimestamp else.
* http://php.net/manual/en/datetime.gettimestamp.php
* @method static setTime($hour, $minute, $second = 0, $microseconds = 0) call \DateTime::setTime if mutable or \DateTimeImmutable::setTime else.
* http://php.net/manual/en/datetime.settime.php
* @method static setISODate($year, $week, $day = 1) call \DateTime::setISODate if mutable or \DateTimeImmutable::setISODate else.
* http://php.net/manual/en/datetime.setisodate.php
* @method static setTimestamp($unixtimestamp) call \DateTime::setTimestamp if mutable or \DateTimeImmutable::setTimestamp else.
* http://php.net/manual/en/datetime.settimestamp.php
* @method \DateInterval diff($object, $absolute = true) call \DateTime::diff if mutable or \DateTimeImmutable::diff else.
* http://php.net/manual/en/datetime.diff.php
* @method bool isUtc() Check if the current instance has UTC timezone.
* @method bool isUTC() Check if the current instance has UTC timezone.
* @method bool isLocal() Check if the current instance has non-UTC timezone.
* @method bool isValid() Check if the current instance is a valid date.
* @method bool isDST() Check if the current instance is in a daylight saving time.
* @method bool isSunday() Checks if the instance day is sunday.
* @method bool isMonday() Checks if the instance day is monday.
* @method bool isTuesday() Checks if the instance day is tuesday.
* @method bool isWednesday() Checks if the instance day is wednesday.
* @method bool isThursday() Checks if the instance day is thursday.
* @method bool isFriday() Checks if the instance day is friday.
* @method bool isSaturday() Checks if the instance day is saturday.
* @method bool isSameYear(\DateTimeInterface $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentYear() Checks if the instance is in the same year as the current moment.
* @method bool isNextYear() Checks if the instance is in the same year as the current moment next year.
* @method bool isLastYear() Checks if the instance is in the same year as the current moment last year.
* @method bool isSameWeek(\DateTimeInterface $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment.
* @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week.
* @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week.
* @method bool isSameDay(\DateTimeInterface $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentDay() Checks if the instance is in the same day as the current moment.
* @method bool isNextDay() Checks if the instance is in the same day as the current moment next day.
* @method bool isLastDay() Checks if the instance is in the same day as the current moment last day.
* @method bool isSameHour(\DateTimeInterface $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment.
* @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour.
* @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour.
* @method bool isSameMinute(\DateTimeInterface $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment.
* @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute.
* @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute.
* @method bool isSameSecond(\DateTimeInterface $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment.
* @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second.
* @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second.
* @method bool isSameMicro(\DateTimeInterface $date = null) Checks if the given date is in the same micro as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMicro() Checks if the instance is in the same micro as the current moment.
* @method bool isNextMicro() Checks if the instance is in the same micro as the current moment next micro.
* @method bool isLastMicro() Checks if the instance is in the same micro as the current moment last micro.
* @method bool isSameMicrosecond(\DateTimeInterface $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment.
* @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond.
* @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond.
* @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment.
* @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month.
* @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month.
* @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment.
* @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter.
* @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter.
* @method bool isSameDecade(\DateTimeInterface $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment.
* @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade.
* @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade.
* @method bool isSameCentury(\DateTimeInterface $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment.
* @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century.
* @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century.
* @method bool isSameMillennium(\DateTimeInterface $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment.
* @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium.
* @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium.
* @method $this years(int $value) Set current instance year to the given value.
* @method $this year(int $value) Set current instance year to the given value.
* @method $this setYears(int $value) Set current instance year to the given value.
* @method $this setYear(int $value) Set current instance year to the given value.
* @method $this months(int $value) Set current instance month to the given value.
* @method $this month(int $value) Set current instance month to the given value.
* @method $this setMonths(int $value) Set current instance month to the given value.
* @method $this setMonth(int $value) Set current instance month to the given value.
* @method $this days(int $value) Set current instance day to the given value.
* @method $this day(int $value) Set current instance day to the given value.
* @method $this setDays(int $value) Set current instance day to the given value.
* @method $this setDay(int $value) Set current instance day to the given value.
* @method $this hours(int $value) Set current instance hour to the given value.
* @method $this hour(int $value) Set current instance hour to the given value.
* @method $this setHours(int $value) Set current instance hour to the given value.
* @method $this setHour(int $value) Set current instance hour to the given value.
* @method $this minutes(int $value) Set current instance minute to the given value.
* @method $this minute(int $value) Set current instance minute to the given value.
* @method $this setMinutes(int $value) Set current instance minute to the given value.
* @method $this setMinute(int $value) Set current instance minute to the given value.
* @method $this seconds(int $value) Set current instance second to the given value.
* @method $this second(int $value) Set current instance second to the given value.
* @method $this setSeconds(int $value) Set current instance second to the given value.
* @method $this setSecond(int $value) Set current instance second to the given value.
* @method $this micros(int $value) Set current instance micro to the given value.
* @method $this micro(int $value) Set current instance micro to the given value.
* @method $this setMicros(int $value) Set current instance micro to the given value.
* @method $this setMicro(int $value) Set current instance micro to the given value.
* @method $this microseconds(int $value) Set current instance microsecond to the given value.
* @method $this microsecond(int $value) Set current instance microsecond to the given value.
* @method $this setMicroseconds(int $value) Set current instance microsecond to the given value.
* @method $this setMicrosecond(int $value) Set current instance microsecond to the given value.
* @method $this addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval).
* @method $this addYear() Add one year to the instance (using date interval).
* @method $this subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
* @method $this subYear() Sub one year to the instance (using date interval).
* @method $this addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed.
* @method $this subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed.
* @method $this addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval).
* @method $this addMonth() Add one month to the instance (using date interval).
* @method $this subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval).
* @method $this subMonth() Sub one month to the instance (using date interval).
* @method $this addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval).
* @method $this addDay() Add one day to the instance (using date interval).
* @method $this subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval).
* @method $this subDay() Sub one day to the instance (using date interval).
* @method $this addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval).
* @method $this addHour() Add one hour to the instance (using date interval).
* @method $this subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval).
* @method $this subHour() Sub one hour to the instance (using date interval).
* @method $this addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval).
* @method $this addMinute() Add one minute to the instance (using date interval).
* @method $this subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval).
* @method $this subMinute() Sub one minute to the instance (using date interval).
* @method $this addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval).
* @method $this addSecond() Add one second to the instance (using date interval).
* @method $this subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval).
* @method $this subSecond() Sub one second to the instance (using date interval).
* @method $this addMicros(int $value = 1) Add micros (the $value count passed in) to the instance (using date interval).
* @method $this addMicro() Add one micro to the instance (using date interval).
* @method $this subMicros(int $value = 1) Sub micros (the $value count passed in) to the instance (using date interval).
* @method $this subMicro() Sub one micro to the instance (using date interval).
* @method $this addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
* @method $this addMicrosecond() Add one microsecond to the instance (using date interval).
* @method $this subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
* @method $this subMicrosecond() Sub one microsecond to the instance (using date interval).
* @method $this addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval).
* @method $this addMillennium() Add one millennium to the instance (using date interval).
* @method $this subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval).
* @method $this subMillennium() Sub one millennium to the instance (using date interval).
* @method $this addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval).
* @method $this addCentury() Add one century to the instance (using date interval).
* @method $this subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval).
* @method $this subCentury() Sub one century to the instance (using date interval).
* @method $this addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed.
* @method $this subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed.
* @method $this addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval).
* @method $this addDecade() Add one decade to the instance (using date interval).
* @method $this subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval).
* @method $this subDecade() Sub one decade to the instance (using date interval).
* @method $this addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed.
* @method $this subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed.
* @method $this addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval).
* @method $this addQuarter() Add one quarter to the instance (using date interval).
* @method $this subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval).
* @method $this subQuarter() Sub one quarter to the instance (using date interval).
* @method $this addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed.
* @method $this subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
* @method $this addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval).
* @method $this addWeek() Add one week to the instance (using date interval).
* @method $this subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval).
* @method $this subWeek() Sub one week to the instance (using date interval).
* @method $this addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval).
* @method $this addWeekday() Add one weekday to the instance (using date interval).
* @method $this subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval).
* @method $this subWeekday() Sub one weekday to the instance (using date interval).
* @method $this addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMicrosecond() Add one microsecond to the instance (using timestamp).
* @method $this subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMicrosecond() Sub one microsecond to the instance (using timestamp).
* @method $this addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp).
* @method $this addRealSecond() Add one second to the instance (using timestamp).
* @method $this subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp).
* @method $this subRealSecond() Sub one second to the instance (using timestamp).
* @method $this addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMinute() Add one minute to the instance (using timestamp).
* @method $this subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMinute() Sub one minute to the instance (using timestamp).
* @method $this addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp).
* @method $this addRealHour() Add one hour to the instance (using timestamp).
* @method $this subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp).
* @method $this subRealHour() Sub one hour to the instance (using timestamp).
* @method $this addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp).
* @method $this addRealDay() Add one day to the instance (using timestamp).
* @method $this subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp).
* @method $this subRealDay() Sub one day to the instance (using timestamp).
* @method $this addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp).
* @method $this addRealWeek() Add one week to the instance (using timestamp).
* @method $this subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp).
* @method $this subRealWeek() Sub one week to the instance (using timestamp).
* @method $this addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMonth() Add one month to the instance (using timestamp).
* @method $this subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMonth() Sub one month to the instance (using timestamp).
* @method $this addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp).
* @method $this addRealQuarter() Add one quarter to the instance (using timestamp).
* @method $this subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp).
* @method $this subRealQuarter() Sub one quarter to the instance (using timestamp).
* @method $this addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp).
* @method $this addRealYear() Add one year to the instance (using timestamp).
* @method $this subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp).
* @method $this subRealYear() Sub one year to the instance (using timestamp).
* @method $this addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp).
* @method $this addRealDecade() Add one decade to the instance (using timestamp).
* @method $this subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp).
* @method $this subRealDecade() Sub one decade to the instance (using timestamp).
* @method $this addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp).
* @method $this addRealCentury() Add one century to the instance (using timestamp).
* @method $this subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp).
* @method $this subRealCentury() Sub one century to the instance (using timestamp).
* @method $this addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMillennium() Add one millennium to the instance (using timestamp).
* @method $this subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMillennium() Sub one millennium to the instance (using timestamp).
* @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
* @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
* @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision.
* @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision.
* @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision.
* @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision.
* @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
* @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
* @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision.
* @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision.
* @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision.
* @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision.
* @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
* @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
* @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision.
* @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision.
* @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision.
* @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision.
* @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
* @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
* @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision.
* @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision.
* @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision.
* @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision.
* @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
* @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
* @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision.
* @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision.
* @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision.
* @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision.
* @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
* @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
* @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision.
* @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision.
* @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision.
* @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision.
* @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
* @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
* @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision.
* @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision.
* @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision.
* @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision.
* @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
* @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
* @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision.
* @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision.
* @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision.
* @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision.
* @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
* @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
* @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision.
* @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision.
* @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision.
* @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision.
* @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
* @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
* @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision.
* @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision.
* @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision.
* @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision.
* @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
* @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
* @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision.
* @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision.
* @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision.
* @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision.
* @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
* @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
* @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision.
* @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision.
* @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision.
* @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision.
* @method string shortAbsoluteDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale.
* @method string shortAbsoluteDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale.
* @method string longAbsoluteDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale.
* @method string longAbsoluteDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale.
* @method string shortRelativeDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale.
* @method string shortRelativeDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale.
* @method string longRelativeDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale.
* @method string longRelativeDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale.
* @method string shortRelativeToNowDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string shortRelativeToNowDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string longRelativeToNowDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string longRelativeToNowDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string shortRelativeToOtherDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string shortRelativeToOtherDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string longRelativeToOtherDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string longRelativeToOtherDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale.
*
*
*/
class Carbon extends DateTime implements CarbonInterface
{
use Date;
public static function isMutable()
{
return true;
}
}
src/Carbon/CarbonImmutable.php 0000644 00000250620 15014555553 0012331 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon;
use Carbon\Traits\Date;
use DateTimeImmutable;
/**
* A simple API extension for DateTimeImmutable.
*
*
*
* @property int $year
* @property int $yearIso
* @property int $month
* @property int $day
* @property int $hour
* @property int $minute
* @property int $second
* @property int $micro
* @property int $microsecond
* @property int $timestamp seconds since the Unix Epoch
* @property string $englishDayOfWeek the day of week in English
* @property string $shortEnglishDayOfWeek the abbreviated day of week in English
* @property string $englishMonth the day of week in English
* @property string $shortEnglishMonth the abbreviated day of week in English
* @property string $localeDayOfWeek the day of week in current locale LC_TIME
* @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME
* @property string $localeMonth the month in current locale LC_TIME
* @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME
* @property int $milliseconds
* @property int $millisecond
* @property int $milli
* @property int $week 1 through 53
* @property int $isoWeek 1 through 53
* @property int $weekYear year according to week format
* @property int $isoWeekYear year according to ISO week format
* @property int $dayOfYear 1 through 366
* @property int $age does a diffInYears() with default parameters
* @property int $offset the timezone offset in seconds from UTC
* @property int $offsetMinutes the timezone offset in minutes from UTC
* @property int $offsetHours the timezone offset in hours from UTC
* @property CarbonTimeZone $timezone the current timezone
* @property CarbonTimeZone $tz alias of $timezone
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
* @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday)
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
* @property-read int $daysInMonth number of days in the given month
* @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
* @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
* @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language
* @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language
* @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
* @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
* @property-read int $noZeroHour current hour from 1 to 24
* @property-read int $weeksInYear 51 through 53
* @property-read int $isoWeeksInYear 51 through 53
* @property-read int $weekOfMonth 1 through 5
* @property-read int $weekNumberInMonth 1 through 5
* @property-read int $firstWeekDay 0 through 6
* @property-read int $lastWeekDay 0 through 6
* @property-read int $daysInYear 365 or 366
* @property-read int $quarter the quarter of this instance, 1 - 4
* @property-read int $decade the decade of this instance
* @property-read int $century the century of this instance
* @property-read int $millennium the millennium of this instance
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
* @property-read string $timezoneName the current timezone name
* @property-read string $tzName alias of $timezoneName
* @property-read string $timezoneAbbreviatedName the current timezone abbreviated name
* @property-read string $tzAbbrName alias of $timezoneAbbreviatedName
* @property-read string $locale locale of the current instance
*
* @method string format($format) call \DateTime::format if mutable or \DateTimeImmutable::format else.
* http://php.net/manual/en/datetime.format.php
* @method static modify($modify) call \DateTime::modify if mutable or \DateTimeImmutable::modify else.
* http://php.net/manual/en/datetime.modify.php
* @method int getOffset() call \DateTime::getOffset if mutable or \DateTimeImmutable::getOffset else.
* http://php.net/manual/en/datetime.getoffset.php
* @method int getTimestamp() call \DateTime::getTimestamp if mutable or \DateTimeImmutable::getTimestamp else.
* http://php.net/manual/en/datetime.gettimestamp.php
* @method static setTime($hour, $minute, $second = 0, $microseconds = 0) call \DateTime::setTime if mutable or \DateTimeImmutable::setTime else.
* http://php.net/manual/en/datetime.settime.php
* @method static setISODate($year, $week, $day = 1) call \DateTime::setISODate if mutable or \DateTimeImmutable::setISODate else.
* http://php.net/manual/en/datetime.setisodate.php
* @method static setTimestamp($unixtimestamp) call \DateTime::setTimestamp if mutable or \DateTimeImmutable::setTimestamp else.
* http://php.net/manual/en/datetime.settimestamp.php
* @method \DateInterval diff($object, $absolute = true) call \DateTime::diff if mutable or \DateTimeImmutable::diff else.
* http://php.net/manual/en/datetime.diff.php
* @method bool isUtc() Check if the current instance has UTC timezone.
* @method bool isUTC() Check if the current instance has UTC timezone.
* @method bool isLocal() Check if the current instance has non-UTC timezone.
* @method bool isValid() Check if the current instance is a valid date.
* @method bool isDST() Check if the current instance is in a daylight saving time.
* @method bool isSunday() Checks if the instance day is sunday.
* @method bool isMonday() Checks if the instance day is monday.
* @method bool isTuesday() Checks if the instance day is tuesday.
* @method bool isWednesday() Checks if the instance day is wednesday.
* @method bool isThursday() Checks if the instance day is thursday.
* @method bool isFriday() Checks if the instance day is friday.
* @method bool isSaturday() Checks if the instance day is saturday.
* @method bool isSameYear(\DateTimeInterface $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentYear() Checks if the instance is in the same year as the current moment.
* @method bool isNextYear() Checks if the instance is in the same year as the current moment next year.
* @method bool isLastYear() Checks if the instance is in the same year as the current moment last year.
* @method bool isSameWeek(\DateTimeInterface $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment.
* @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week.
* @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week.
* @method bool isSameDay(\DateTimeInterface $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentDay() Checks if the instance is in the same day as the current moment.
* @method bool isNextDay() Checks if the instance is in the same day as the current moment next day.
* @method bool isLastDay() Checks if the instance is in the same day as the current moment last day.
* @method bool isSameHour(\DateTimeInterface $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment.
* @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour.
* @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour.
* @method bool isSameMinute(\DateTimeInterface $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment.
* @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute.
* @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute.
* @method bool isSameSecond(\DateTimeInterface $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment.
* @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second.
* @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second.
* @method bool isSameMicro(\DateTimeInterface $date = null) Checks if the given date is in the same micro as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMicro() Checks if the instance is in the same micro as the current moment.
* @method bool isNextMicro() Checks if the instance is in the same micro as the current moment next micro.
* @method bool isLastMicro() Checks if the instance is in the same micro as the current moment last micro.
* @method bool isSameMicrosecond(\DateTimeInterface $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment.
* @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond.
* @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond.
* @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment.
* @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month.
* @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month.
* @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment.
* @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter.
* @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter.
* @method bool isSameDecade(\DateTimeInterface $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment.
* @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade.
* @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade.
* @method bool isSameCentury(\DateTimeInterface $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment.
* @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century.
* @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century.
* @method bool isSameMillennium(\DateTimeInterface $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment.
* @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium.
* @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium.
* @method $this years(int $value) Set current instance year to the given value.
* @method $this year(int $value) Set current instance year to the given value.
* @method $this setYears(int $value) Set current instance year to the given value.
* @method $this setYear(int $value) Set current instance year to the given value.
* @method $this months(int $value) Set current instance month to the given value.
* @method $this month(int $value) Set current instance month to the given value.
* @method $this setMonths(int $value) Set current instance month to the given value.
* @method $this setMonth(int $value) Set current instance month to the given value.
* @method $this days(int $value) Set current instance day to the given value.
* @method $this day(int $value) Set current instance day to the given value.
* @method $this setDays(int $value) Set current instance day to the given value.
* @method $this setDay(int $value) Set current instance day to the given value.
* @method $this hours(int $value) Set current instance hour to the given value.
* @method $this hour(int $value) Set current instance hour to the given value.
* @method $this setHours(int $value) Set current instance hour to the given value.
* @method $this setHour(int $value) Set current instance hour to the given value.
* @method $this minutes(int $value) Set current instance minute to the given value.
* @method $this minute(int $value) Set current instance minute to the given value.
* @method $this setMinutes(int $value) Set current instance minute to the given value.
* @method $this setMinute(int $value) Set current instance minute to the given value.
* @method $this seconds(int $value) Set current instance second to the given value.
* @method $this second(int $value) Set current instance second to the given value.
* @method $this setSeconds(int $value) Set current instance second to the given value.
* @method $this setSecond(int $value) Set current instance second to the given value.
* @method $this micros(int $value) Set current instance micro to the given value.
* @method $this micro(int $value) Set current instance micro to the given value.
* @method $this setMicros(int $value) Set current instance micro to the given value.
* @method $this setMicro(int $value) Set current instance micro to the given value.
* @method $this microseconds(int $value) Set current instance microsecond to the given value.
* @method $this microsecond(int $value) Set current instance microsecond to the given value.
* @method $this setMicroseconds(int $value) Set current instance microsecond to the given value.
* @method $this setMicrosecond(int $value) Set current instance microsecond to the given value.
* @method $this addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval).
* @method $this addYear() Add one year to the instance (using date interval).
* @method $this subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
* @method $this subYear() Sub one year to the instance (using date interval).
* @method $this addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed.
* @method $this subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed.
* @method $this addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval).
* @method $this addMonth() Add one month to the instance (using date interval).
* @method $this subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval).
* @method $this subMonth() Sub one month to the instance (using date interval).
* @method $this addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval).
* @method $this addDay() Add one day to the instance (using date interval).
* @method $this subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval).
* @method $this subDay() Sub one day to the instance (using date interval).
* @method $this addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval).
* @method $this addHour() Add one hour to the instance (using date interval).
* @method $this subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval).
* @method $this subHour() Sub one hour to the instance (using date interval).
* @method $this addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval).
* @method $this addMinute() Add one minute to the instance (using date interval).
* @method $this subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval).
* @method $this subMinute() Sub one minute to the instance (using date interval).
* @method $this addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval).
* @method $this addSecond() Add one second to the instance (using date interval).
* @method $this subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval).
* @method $this subSecond() Sub one second to the instance (using date interval).
* @method $this addMicros(int $value = 1) Add micros (the $value count passed in) to the instance (using date interval).
* @method $this addMicro() Add one micro to the instance (using date interval).
* @method $this subMicros(int $value = 1) Sub micros (the $value count passed in) to the instance (using date interval).
* @method $this subMicro() Sub one micro to the instance (using date interval).
* @method $this addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
* @method $this addMicrosecond() Add one microsecond to the instance (using date interval).
* @method $this subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
* @method $this subMicrosecond() Sub one microsecond to the instance (using date interval).
* @method $this addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval).
* @method $this addMillennium() Add one millennium to the instance (using date interval).
* @method $this subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval).
* @method $this subMillennium() Sub one millennium to the instance (using date interval).
* @method $this addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval).
* @method $this addCentury() Add one century to the instance (using date interval).
* @method $this subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval).
* @method $this subCentury() Sub one century to the instance (using date interval).
* @method $this addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed.
* @method $this subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed.
* @method $this addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval).
* @method $this addDecade() Add one decade to the instance (using date interval).
* @method $this subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval).
* @method $this subDecade() Sub one decade to the instance (using date interval).
* @method $this addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed.
* @method $this subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed.
* @method $this addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval).
* @method $this addQuarter() Add one quarter to the instance (using date interval).
* @method $this subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval).
* @method $this subQuarter() Sub one quarter to the instance (using date interval).
* @method $this addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed.
* @method $this subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
* @method $this addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval).
* @method $this addWeek() Add one week to the instance (using date interval).
* @method $this subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval).
* @method $this subWeek() Sub one week to the instance (using date interval).
* @method $this addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval).
* @method $this addWeekday() Add one weekday to the instance (using date interval).
* @method $this subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval).
* @method $this subWeekday() Sub one weekday to the instance (using date interval).
* @method $this addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMicrosecond() Add one microsecond to the instance (using timestamp).
* @method $this subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMicrosecond() Sub one microsecond to the instance (using timestamp).
* @method $this addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp).
* @method $this addRealSecond() Add one second to the instance (using timestamp).
* @method $this subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp).
* @method $this subRealSecond() Sub one second to the instance (using timestamp).
* @method $this addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMinute() Add one minute to the instance (using timestamp).
* @method $this subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMinute() Sub one minute to the instance (using timestamp).
* @method $this addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp).
* @method $this addRealHour() Add one hour to the instance (using timestamp).
* @method $this subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp).
* @method $this subRealHour() Sub one hour to the instance (using timestamp).
* @method $this addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp).
* @method $this addRealDay() Add one day to the instance (using timestamp).
* @method $this subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp).
* @method $this subRealDay() Sub one day to the instance (using timestamp).
* @method $this addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp).
* @method $this addRealWeek() Add one week to the instance (using timestamp).
* @method $this subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp).
* @method $this subRealWeek() Sub one week to the instance (using timestamp).
* @method $this addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMonth() Add one month to the instance (using timestamp).
* @method $this subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMonth() Sub one month to the instance (using timestamp).
* @method $this addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp).
* @method $this addRealQuarter() Add one quarter to the instance (using timestamp).
* @method $this subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp).
* @method $this subRealQuarter() Sub one quarter to the instance (using timestamp).
* @method $this addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp).
* @method $this addRealYear() Add one year to the instance (using timestamp).
* @method $this subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp).
* @method $this subRealYear() Sub one year to the instance (using timestamp).
* @method $this addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp).
* @method $this addRealDecade() Add one decade to the instance (using timestamp).
* @method $this subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp).
* @method $this subRealDecade() Sub one decade to the instance (using timestamp).
* @method $this addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp).
* @method $this addRealCentury() Add one century to the instance (using timestamp).
* @method $this subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp).
* @method $this subRealCentury() Sub one century to the instance (using timestamp).
* @method $this addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMillennium() Add one millennium to the instance (using timestamp).
* @method $this subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMillennium() Sub one millennium to the instance (using timestamp).
* @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
* @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
* @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision.
* @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision.
* @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision.
* @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision.
* @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
* @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
* @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision.
* @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision.
* @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision.
* @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision.
* @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
* @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
* @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision.
* @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision.
* @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision.
* @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision.
* @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
* @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
* @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision.
* @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision.
* @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision.
* @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision.
* @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
* @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
* @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision.
* @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision.
* @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision.
* @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision.
* @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
* @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
* @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision.
* @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision.
* @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision.
* @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision.
* @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
* @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
* @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision.
* @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision.
* @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision.
* @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision.
* @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
* @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
* @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision.
* @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision.
* @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision.
* @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision.
* @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
* @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
* @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision.
* @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision.
* @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision.
* @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision.
* @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
* @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
* @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision.
* @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision.
* @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision.
* @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision.
* @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
* @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
* @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision.
* @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision.
* @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision.
* @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision.
* @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
* @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
* @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision.
* @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision.
* @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision.
* @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision.
* @method string shortAbsoluteDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale.
* @method string shortAbsoluteDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale.
* @method string longAbsoluteDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale.
* @method string longAbsoluteDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale.
* @method string shortRelativeDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale.
* @method string shortRelativeDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale.
* @method string longRelativeDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale.
* @method string longRelativeDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale.
* @method string shortRelativeToNowDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string shortRelativeToNowDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string longRelativeToNowDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string longRelativeToNowDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string shortRelativeToOtherDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string shortRelativeToOtherDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string longRelativeToOtherDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string longRelativeToOtherDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale.
*
*
*/
class CarbonImmutable extends DateTimeImmutable implements CarbonInterface
{
use Date;
}
src/Carbon/CarbonInterface.php 0000644 00000311621 15014555553 0012311 0 ustar 00
*
* @property int $year
* @property int $yearIso
* @property int $month
* @property int $day
* @property int $hour
* @property int $minute
* @property int $second
* @property int $micro
* @property int $microsecond
* @property int $timestamp seconds since the Unix Epoch
* @property string $englishDayOfWeek the day of week in English
* @property string $shortEnglishDayOfWeek the abbreviated day of week in English
* @property string $englishMonth the day of week in English
* @property string $shortEnglishMonth the abbreviated day of week in English
* @property string $localeDayOfWeek the day of week in current locale LC_TIME
* @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME
* @property string $localeMonth the month in current locale LC_TIME
* @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME
* @property int $milliseconds
* @property int $millisecond
* @property int $milli
* @property int $week 1 through 53
* @property int $isoWeek 1 through 53
* @property int $weekYear year according to week format
* @property int $isoWeekYear year according to ISO week format
* @property int $dayOfYear 1 through 366
* @property int $age does a diffInYears() with default parameters
* @property int $offset the timezone offset in seconds from UTC
* @property int $offsetMinutes the timezone offset in minutes from UTC
* @property int $offsetHours the timezone offset in hours from UTC
* @property CarbonTimeZone $timezone the current timezone
* @property CarbonTimeZone $tz alias of $timezone
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
* @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday)
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
* @property-read int $daysInMonth number of days in the given month
* @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
* @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
* @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language
* @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language
* @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
* @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
* @property-read int $noZeroHour current hour from 1 to 24
* @property-read int $weeksInYear 51 through 53
* @property-read int $isoWeeksInYear 51 through 53
* @property-read int $weekOfMonth 1 through 5
* @property-read int $weekNumberInMonth 1 through 5
* @property-read int $firstWeekDay 0 through 6
* @property-read int $lastWeekDay 0 through 6
* @property-read int $daysInYear 365 or 366
* @property-read int $quarter the quarter of this instance, 1 - 4
* @property-read int $decade the decade of this instance
* @property-read int $century the century of this instance
* @property-read int $millennium the millennium of this instance
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
* @property-read string $timezoneName the current timezone name
* @property-read string $tzName alias of $timezoneName
* @property-read string $timezoneAbbreviatedName the current timezone abbreviated name
* @property-read string $tzAbbrName alias of $timezoneAbbreviatedName
* @property-read string $locale locale of the current instance
*
* @method string format($format) call \DateTime::format if mutable or \DateTimeImmutable::format else.
* http://php.net/manual/en/datetime.format.php
* @method static modify($modify) call \DateTime::modify if mutable or \DateTimeImmutable::modify else.
* http://php.net/manual/en/datetime.modify.php
* @method int getOffset() call \DateTime::getOffset if mutable or \DateTimeImmutable::getOffset else.
* http://php.net/manual/en/datetime.getoffset.php
* @method int getTimestamp() call \DateTime::getTimestamp if mutable or \DateTimeImmutable::getTimestamp else.
* http://php.net/manual/en/datetime.gettimestamp.php
* @method static setTime($hour, $minute, $second = 0, $microseconds = 0) call \DateTime::setTime if mutable or \DateTimeImmutable::setTime else.
* http://php.net/manual/en/datetime.settime.php
* @method static setISODate($year, $week, $day = 1) call \DateTime::setISODate if mutable or \DateTimeImmutable::setISODate else.
* http://php.net/manual/en/datetime.setisodate.php
* @method static setTimestamp($unixtimestamp) call \DateTime::setTimestamp if mutable or \DateTimeImmutable::setTimestamp else.
* http://php.net/manual/en/datetime.settimestamp.php
* @method \DateInterval diff($object, $absolute = true) call \DateTime::diff if mutable or \DateTimeImmutable::diff else.
* http://php.net/manual/en/datetime.diff.php
* @method bool isUtc() Check if the current instance has UTC timezone.
* @method bool isUTC() Check if the current instance has UTC timezone.
* @method bool isLocal() Check if the current instance has non-UTC timezone.
* @method bool isValid() Check if the current instance is a valid date.
* @method bool isDST() Check if the current instance is in a daylight saving time.
* @method bool isSunday() Checks if the instance day is sunday.
* @method bool isMonday() Checks if the instance day is monday.
* @method bool isTuesday() Checks if the instance day is tuesday.
* @method bool isWednesday() Checks if the instance day is wednesday.
* @method bool isThursday() Checks if the instance day is thursday.
* @method bool isFriday() Checks if the instance day is friday.
* @method bool isSaturday() Checks if the instance day is saturday.
* @method bool isSameYear(\DateTimeInterface $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentYear() Checks if the instance is in the same year as the current moment.
* @method bool isNextYear() Checks if the instance is in the same year as the current moment next year.
* @method bool isLastYear() Checks if the instance is in the same year as the current moment last year.
* @method bool isSameWeek(\DateTimeInterface $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment.
* @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week.
* @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week.
* @method bool isSameDay(\DateTimeInterface $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentDay() Checks if the instance is in the same day as the current moment.
* @method bool isNextDay() Checks if the instance is in the same day as the current moment next day.
* @method bool isLastDay() Checks if the instance is in the same day as the current moment last day.
* @method bool isSameHour(\DateTimeInterface $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment.
* @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour.
* @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour.
* @method bool isSameMinute(\DateTimeInterface $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment.
* @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute.
* @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute.
* @method bool isSameSecond(\DateTimeInterface $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment.
* @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second.
* @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second.
* @method bool isSameMicro(\DateTimeInterface $date = null) Checks if the given date is in the same micro as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMicro() Checks if the instance is in the same micro as the current moment.
* @method bool isNextMicro() Checks if the instance is in the same micro as the current moment next micro.
* @method bool isLastMicro() Checks if the instance is in the same micro as the current moment last micro.
* @method bool isSameMicrosecond(\DateTimeInterface $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment.
* @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond.
* @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond.
* @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment.
* @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month.
* @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month.
* @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment.
* @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter.
* @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter.
* @method bool isSameDecade(\DateTimeInterface $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment.
* @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade.
* @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade.
* @method bool isSameCentury(\DateTimeInterface $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment.
* @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century.
* @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century.
* @method bool isSameMillennium(\DateTimeInterface $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment.
* @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium.
* @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium.
* @method $this years(int $value) Set current instance year to the given value.
* @method $this year(int $value) Set current instance year to the given value.
* @method $this setYears(int $value) Set current instance year to the given value.
* @method $this setYear(int $value) Set current instance year to the given value.
* @method $this months(int $value) Set current instance month to the given value.
* @method $this month(int $value) Set current instance month to the given value.
* @method $this setMonths(int $value) Set current instance month to the given value.
* @method $this setMonth(int $value) Set current instance month to the given value.
* @method $this days(int $value) Set current instance day to the given value.
* @method $this day(int $value) Set current instance day to the given value.
* @method $this setDays(int $value) Set current instance day to the given value.
* @method $this setDay(int $value) Set current instance day to the given value.
* @method $this hours(int $value) Set current instance hour to the given value.
* @method $this hour(int $value) Set current instance hour to the given value.
* @method $this setHours(int $value) Set current instance hour to the given value.
* @method $this setHour(int $value) Set current instance hour to the given value.
* @method $this minutes(int $value) Set current instance minute to the given value.
* @method $this minute(int $value) Set current instance minute to the given value.
* @method $this setMinutes(int $value) Set current instance minute to the given value.
* @method $this setMinute(int $value) Set current instance minute to the given value.
* @method $this seconds(int $value) Set current instance second to the given value.
* @method $this second(int $value) Set current instance second to the given value.
* @method $this setSeconds(int $value) Set current instance second to the given value.
* @method $this setSecond(int $value) Set current instance second to the given value.
* @method $this micros(int $value) Set current instance micro to the given value.
* @method $this micro(int $value) Set current instance micro to the given value.
* @method $this setMicros(int $value) Set current instance micro to the given value.
* @method $this setMicro(int $value) Set current instance micro to the given value.
* @method $this microseconds(int $value) Set current instance microsecond to the given value.
* @method $this microsecond(int $value) Set current instance microsecond to the given value.
* @method $this setMicroseconds(int $value) Set current instance microsecond to the given value.
* @method $this setMicrosecond(int $value) Set current instance microsecond to the given value.
* @method $this addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval).
* @method $this addYear() Add one year to the instance (using date interval).
* @method $this subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
* @method $this subYear() Sub one year to the instance (using date interval).
* @method $this addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed.
* @method $this subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed.
* @method $this addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval).
* @method $this addMonth() Add one month to the instance (using date interval).
* @method $this subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval).
* @method $this subMonth() Sub one month to the instance (using date interval).
* @method $this addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval).
* @method $this addDay() Add one day to the instance (using date interval).
* @method $this subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval).
* @method $this subDay() Sub one day to the instance (using date interval).
* @method $this addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval).
* @method $this addHour() Add one hour to the instance (using date interval).
* @method $this subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval).
* @method $this subHour() Sub one hour to the instance (using date interval).
* @method $this addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval).
* @method $this addMinute() Add one minute to the instance (using date interval).
* @method $this subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval).
* @method $this subMinute() Sub one minute to the instance (using date interval).
* @method $this addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval).
* @method $this addSecond() Add one second to the instance (using date interval).
* @method $this subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval).
* @method $this subSecond() Sub one second to the instance (using date interval).
* @method $this addMicros(int $value = 1) Add micros (the $value count passed in) to the instance (using date interval).
* @method $this addMicro() Add one micro to the instance (using date interval).
* @method $this subMicros(int $value = 1) Sub micros (the $value count passed in) to the instance (using date interval).
* @method $this subMicro() Sub one micro to the instance (using date interval).
* @method $this addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
* @method $this addMicrosecond() Add one microsecond to the instance (using date interval).
* @method $this subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
* @method $this subMicrosecond() Sub one microsecond to the instance (using date interval).
* @method $this addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval).
* @method $this addMillennium() Add one millennium to the instance (using date interval).
* @method $this subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval).
* @method $this subMillennium() Sub one millennium to the instance (using date interval).
* @method $this addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval).
* @method $this addCentury() Add one century to the instance (using date interval).
* @method $this subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval).
* @method $this subCentury() Sub one century to the instance (using date interval).
* @method $this addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed.
* @method $this subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed.
* @method $this addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval).
* @method $this addDecade() Add one decade to the instance (using date interval).
* @method $this subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval).
* @method $this subDecade() Sub one decade to the instance (using date interval).
* @method $this addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed.
* @method $this subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed.
* @method $this addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval).
* @method $this addQuarter() Add one quarter to the instance (using date interval).
* @method $this subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval).
* @method $this subQuarter() Sub one quarter to the instance (using date interval).
* @method $this addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed.
* @method $this subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
* @method $this addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval).
* @method $this addWeek() Add one week to the instance (using date interval).
* @method $this subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval).
* @method $this subWeek() Sub one week to the instance (using date interval).
* @method $this addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval).
* @method $this addWeekday() Add one weekday to the instance (using date interval).
* @method $this subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval).
* @method $this subWeekday() Sub one weekday to the instance (using date interval).
* @method $this addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMicrosecond() Add one microsecond to the instance (using timestamp).
* @method $this subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMicrosecond() Sub one microsecond to the instance (using timestamp).
* @method $this addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp).
* @method $this addRealSecond() Add one second to the instance (using timestamp).
* @method $this subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp).
* @method $this subRealSecond() Sub one second to the instance (using timestamp).
* @method $this addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMinute() Add one minute to the instance (using timestamp).
* @method $this subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMinute() Sub one minute to the instance (using timestamp).
* @method $this addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp).
* @method $this addRealHour() Add one hour to the instance (using timestamp).
* @method $this subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp).
* @method $this subRealHour() Sub one hour to the instance (using timestamp).
* @method $this addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp).
* @method $this addRealDay() Add one day to the instance (using timestamp).
* @method $this subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp).
* @method $this subRealDay() Sub one day to the instance (using timestamp).
* @method $this addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp).
* @method $this addRealWeek() Add one week to the instance (using timestamp).
* @method $this subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp).
* @method $this subRealWeek() Sub one week to the instance (using timestamp).
* @method $this addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMonth() Add one month to the instance (using timestamp).
* @method $this subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMonth() Sub one month to the instance (using timestamp).
* @method $this addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp).
* @method $this addRealQuarter() Add one quarter to the instance (using timestamp).
* @method $this subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp).
* @method $this subRealQuarter() Sub one quarter to the instance (using timestamp).
* @method $this addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp).
* @method $this addRealYear() Add one year to the instance (using timestamp).
* @method $this subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp).
* @method $this subRealYear() Sub one year to the instance (using timestamp).
* @method $this addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp).
* @method $this addRealDecade() Add one decade to the instance (using timestamp).
* @method $this subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp).
* @method $this subRealDecade() Sub one decade to the instance (using timestamp).
* @method $this addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp).
* @method $this addRealCentury() Add one century to the instance (using timestamp).
* @method $this subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp).
* @method $this subRealCentury() Sub one century to the instance (using timestamp).
* @method $this addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMillennium() Add one millennium to the instance (using timestamp).
* @method $this subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMillennium() Sub one millennium to the instance (using timestamp).
* @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
* @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
* @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision.
* @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision.
* @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision.
* @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision.
* @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
* @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
* @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision.
* @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision.
* @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision.
* @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision.
* @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
* @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
* @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision.
* @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision.
* @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision.
* @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision.
* @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
* @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
* @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision.
* @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision.
* @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision.
* @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision.
* @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
* @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
* @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision.
* @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision.
* @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision.
* @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision.
* @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
* @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
* @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision.
* @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision.
* @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision.
* @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision.
* @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
* @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
* @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision.
* @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision.
* @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision.
* @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision.
* @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
* @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
* @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision.
* @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision.
* @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision.
* @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision.
* @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
* @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
* @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision.
* @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision.
* @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision.
* @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision.
* @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
* @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
* @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision.
* @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision.
* @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision.
* @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision.
* @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
* @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
* @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision.
* @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision.
* @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision.
* @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision.
* @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
* @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
* @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision.
* @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision.
* @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision.
* @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision.
* @method string shortAbsoluteDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale.
* @method string shortAbsoluteDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale.
* @method string longAbsoluteDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale.
* @method string longAbsoluteDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale.
* @method string shortRelativeDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale.
* @method string shortRelativeDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale.
* @method string longRelativeDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale.
* @method string longRelativeDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale.
* @method string shortRelativeToNowDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string shortRelativeToNowDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string longRelativeToNowDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string longRelativeToNowDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string shortRelativeToOtherDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string shortRelativeToOtherDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string longRelativeToOtherDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string longRelativeToOtherDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale.
*
*
*/
interface CarbonInterface extends DateTimeInterface, JsonSerializable
{
/**
* Diff wording options.
*/
public const NO_ZERO_DIFF = 01;
public const JUST_NOW = 02;
public const ONE_DAY_WORDS = 04;
public const TWO_DAY_WORDS = 010;
/**
* Diff syntax options.
*/
public const DIFF_ABSOLUTE = 1; // backward compatibility with true
public const DIFF_RELATIVE_AUTO = 0; // backward compatibility with false
public const DIFF_RELATIVE_TO_NOW = 2;
public const DIFF_RELATIVE_TO_OTHER = 3;
/**
* The day constants.
*/
public const SUNDAY = 0;
public const MONDAY = 1;
public const TUESDAY = 2;
public const WEDNESDAY = 3;
public const THURSDAY = 4;
public const FRIDAY = 5;
public const SATURDAY = 6;
/**
* Number of X in Y.
*/
public const YEARS_PER_MILLENNIUM = 1000;
public const YEARS_PER_CENTURY = 100;
public const YEARS_PER_DECADE = 10;
public const MONTHS_PER_YEAR = 12;
public const MONTHS_PER_QUARTER = 3;
public const WEEKS_PER_YEAR = 52;
public const WEEKS_PER_MONTH = 4;
public const DAYS_PER_WEEK = 7;
public const HOURS_PER_DAY = 24;
public const MINUTES_PER_HOUR = 60;
public const SECONDS_PER_MINUTE = 60;
public const MICROSECONDS_PER_SECOND = 1000000;
/**
* RFC7231 DateTime format.
*
* @var string
*/
public const RFC7231_FORMAT = 'D, d M Y H:i:s \G\M\T';
/**
* Default format to use for __toString method when type juggling occurs.
*
* @var string
*/
public const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s';
/**
* Format for converting mocked time, includes microseconds.
*
* @var string
*/
public const MOCK_DATETIME_FORMAT = 'Y-m-d H:i:s.u';
//
public function __call($method, $parameters);
public static function __callStatic($method, $parameters);
public function __construct($time = null, $tz = null);
public function __get($name);
public function __isset($name);
public function __set($name, $value);
public static function __set_state($dump);
public function __sleep();
public function __toString();
public function add($unit, $value = 1, $overflow = null);
public function addRealUnit($unit, $value = 1);
public function addUnit($unit, $value = 1, $overflow = null);
public function addUnitNoOverflow($valueUnit, $value, $overflowUnit);
public function average($date = null);
public function between($date1, $date2, $equal = true): bool;
public function calendar($referenceTime = null, array $formats = []);
public function ceil($precision = 1);
public function ceilUnit($unit, $precision = 1);
public function ceilWeek($weekStartsAt = null);
public function clone();
public function closest($date1, $date2);
public function copy();
public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null);
public static function createFromDate($year = null, $month = null, $day = null, $tz = null);
public static function createFromFormat($format, $time, $tz = null);
public static function createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null);
public static function createFromTimeString($time, $tz = null);
public static function createFromTimestamp($timestamp, $tz = null);
public static function createFromTimestampMs($timestamp, $tz = null);
public static function createFromTimestampUTC($timestamp);
public static function createMidnightDate($year = null, $month = null, $day = null, $tz = null);
public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null);
public function dayOfYear($value = null);
public function diffAsCarbonInterval($date = null, $absolute = true);
public function diffFiltered(\Carbon\CarbonInterval $ci, \Closure $callback, $date = null, $absolute = true);
public function diffForHumans($other = null, $syntax = null, $short = false, $parts = 1, $options = null);
public function diffInDays($date = null, $absolute = true);
public function diffInDaysFiltered(\Closure $callback, $date = null, $absolute = true);
public function diffInHours($date = null, $absolute = true);
public function diffInHoursFiltered(\Closure $callback, $date = null, $absolute = true);
public function diffInMicroseconds($date = null, $absolute = true);
public function diffInMinutes($date = null, $absolute = true);
public function diffInMonths($date = null, $absolute = true);
public function diffInRealHours($date = null, $absolute = true);
public function diffInRealMicroseconds($date = null, $absolute = true);
public function diffInRealMinutes($date = null, $absolute = true);
public function diffInRealSeconds($date = null, $absolute = true);
public function diffInSeconds($date = null, $absolute = true);
public function diffInWeekdays($date = null, $absolute = true);
public function diffInWeekendDays($date = null, $absolute = true);
public function diffInWeeks($date = null, $absolute = true);
public function diffInYears($date = null, $absolute = true);
public static function disableHumanDiffOption($humanDiffOption);
public static function enableHumanDiffOption($humanDiffOption);
public function endOf($unit, ...$params);
public function endOfCentury();
public function endOfDay();
public function endOfDecade();
public function endOfHour();
public function endOfMillennium();
public function endOfMinute();
public function endOfMonth();
public function endOfQuarter();
public function endOfSecond();
public function endOfWeek($weekEndsAt = null);
public function endOfYear();
public function eq($date): bool;
public function equalTo($date): bool;
public static function executeWithLocale($locale, $func);
public function farthest($date1, $date2);
public function firstOfMonth($dayOfWeek = null);
public function firstOfQuarter($dayOfWeek = null);
public function firstOfYear($dayOfWeek = null);
public function floor($precision = 1);
public function floorUnit($unit, $precision = 1);
public function floorWeek($weekStartsAt = null);
public function formatLocalized($format);
public function from($other = null, $syntax = null, $short = false, $parts = 1, $options = null);
public function fromNow($syntax = null, $short = false, $parts = 1, $options = null);
public static function fromSerialized($value);
public function get($name);
public static function getAvailableLocales();
public function getCalendarFormats($locale = null);
public static function getDays();
public static function getHumanDiffOptions();
public function getIsoFormats($locale = null);
public static function getIsoUnits();
public static function getLastErrors();
public function getLocalTranslator();
public static function getLocale();
public static function getMidDayAt();
public function getOffsetString($separator = ':');
public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = 0);
public function getPreciseTimestamp($precision = 6);
public static function getTestNow();
public function getTranslationMessage(string $key, string $locale = null, string $default = null);
public static function getTranslator();
public static function getWeekEndsAt();
public static function getWeekStartsAt();
public static function getWeekendDays();
public function greaterThan($date): bool;
public function greaterThanOrEqualTo($date): bool;
public function gt($date): bool;
public function gte($date): bool;
public static function hasFormat($date, $format);
public static function hasMacro($name);
public static function hasRelativeKeywords($time);
public static function hasTestNow();
public static function instance($date);
public function isAfter($date): bool;
public function isBefore($date): bool;
public function isBetween($date1, $date2, $equal = true): bool;
public function isBirthday($date = null);
public function isCurrentUnit($unit);
public function isDayOfWeek($dayOfWeek);
public function isEndOfDay($checkMicroseconds = false);
public function isFuture();
public static function isImmutable();
public function isLastOfMonth();
public function isLeapYear();
public function isLongYear();
public function isMidday();
public function isMidnight();
public static function isModifiableUnit($unit);
public static function isMutable();
public function isPast();
public function isSameAs($format, $date = null);
public function isSameMonth($date = null, $ofSameYear = true);
public function isSameQuarter($date = null, $ofSameYear = true);
public function isSameUnit($unit, $date = null);
public function isStartOfDay($checkMicroseconds = false);
public static function isStrictModeEnabled();
public function isToday();
public function isTomorrow();
public function isWeekday();
public function isWeekend();
public function isYesterday();
public function isoFormat(string $format): string;
public function isoWeek($week = null, $dayOfWeek = null, $dayOfYear = null);
public function isoWeekYear($year = null, $dayOfWeek = null, $dayOfYear = null);
public function isoWeekday($value = null);
public function isoWeeksInYear($dayOfWeek = null, $dayOfYear = null);
public function jsonSerialize();
public function lastOfMonth($dayOfWeek = null);
public function lastOfQuarter($dayOfWeek = null);
public function lastOfYear($dayOfWeek = null);
public function lessThan($date): bool;
public function lessThanOrEqualTo($date): bool;
public function locale(string $locale = null);
public static function localeHasDiffOneDayWords($locale);
public static function localeHasDiffSyntax($locale);
public static function localeHasDiffTwoDayWords($locale);
public static function localeHasPeriodSyntax($locale);
public static function localeHasShortUnits($locale);
public function lt($date): bool;
public function lte($date): bool;
public static function macro($name, $macro);
public static function make($var);
public function max($date = null);
public static function maxValue();
public function maximum($date = null);
public function midDay();
public function min($date = null);
public static function minValue();
public function minimum($date = null);
public static function mixin($mixin);
public function modify($modify);
public function ne($date): bool;
public function next($dayOfWeek = null);
public function nextWeekday();
public function nextWeekendDay();
public function notEqualTo($date): bool;
public static function now($tz = null);
public function nowWithSameTz();
public function nthOfMonth($nth, $dayOfWeek);
public function nthOfQuarter($nth, $dayOfWeek);
public function nthOfYear($nth, $dayOfWeek);
public function ordinal(string $key, string $period = null): string;
public static function parse($time = null, $tz = null);
public static function pluralUnit(string $unit): string;
public function previous($dayOfWeek = null);
public function previousWeekday();
public function previousWeekendDay();
public static function resetMonthsOverflow();
public static function resetToStringFormat();
public static function resetYearsOverflow();
public function round($precision = 1, $function = 'round');
public function roundUnit($unit, $precision = 1, $function = 'round');
public function roundWeek($weekStartsAt = null);
public function secondsSinceMidnight();
public function secondsUntilEndOfDay();
public function serialize();
public static function serializeUsing($callback);
public function set($name, $value = null);
public function setDate($year, $month, $day);
public function setDateFrom($date = null);
public function setDateTime($year, $month, $day, $hour, $minute, $second = 0, $microseconds = 0);
public function setDateTimeFrom($date = null);
public static function setHumanDiffOptions($humanDiffOptions);
public function setISODate($year, $week, $day);
public function setLocalTranslator(\Symfony\Component\Translation\TranslatorInterface $translator);
public static function setLocale($locale);
public static function setMidDayAt($hour);
public static function setTestNow($testNow = null);
public function setTime($hour, $minute, $second, $microseconds);
public function setTimeFrom($date = null);
public function setTimeFromTimeString($time);
public function setTimestamp($unixtimestamp);
public function setTimezone($value);
public static function setToStringFormat($format);
public static function setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator);
public function setUnit($unit, $value = null);
public function setUnitNoOverflow($valueUnit, $value, $overflowUnit);
public static function setUtf8($utf8);
public static function setWeekEndsAt($day);
public static function setWeekStartsAt($day);
public static function setWeekendDays($days);
public function settings(array $settings);
public function shiftTimezone($value);
public static function shouldOverflowMonths();
public static function shouldOverflowYears();
public function since($other = null, $syntax = null, $short = false, $parts = 1, $options = null);
public static function singularUnit(string $unit): string;
public function startOf($unit, ...$params);
public function startOfCentury();
public function startOfDay();
public function startOfDecade();
public function startOfHour();
public function startOfMillennium();
public function startOfMinute();
public function startOfMonth();
public function startOfQuarter();
public function startOfSecond();
public function startOfWeek($weekStartsAt = null);
public function startOfYear();
public function sub($unit, $value = 1, $overflow = null);
public function subRealUnit($unit, $value = 1);
public function subUnit($unit, $value = 1, $overflow = null);
public function subUnitNoOverflow($valueUnit, $value, $overflowUnit);
public function subtract($unit, $value = 1, $overflow = null);
public function timestamp($value);
public function timezone($value);
public function to($other = null, $syntax = null, $short = false, $parts = 1, $options = null);
public function toArray();
public function toAtomString();
public function toCookieString();
public function toDate();
public function toDateString();
public function toDateTime();
public function toDateTimeString();
public function toDayDateTimeString();
public function toFormattedDateString();
public function toISOString($keepOffset = false);
public function toImmutable();
public function toIso8601String();
public function toIso8601ZuluString();
public function toJSON();
public function toMutable();
public function toNow($syntax = null, $short = false, $parts = 1, $options = null);
public function toObject();
public function toRfc1036String();
public function toRfc1123String();
public function toRfc2822String();
public function toRfc3339String();
public function toRfc7231String();
public function toRfc822String();
public function toRfc850String();
public function toRssString();
public function toString();
public function toTimeString();
public function toW3cString();
public static function today($tz = null);
public static function tomorrow($tz = null);
public function translate(string $key, array $parameters = [], $number = null): string;
public function tz($value = null);
public function unix();
public function until($other = null, $syntax = null, $short = false, $parts = 1, $options = null);
public static function useMonthsOverflow($monthsOverflow = true);
public static function useStrictMode($strictModeEnabled = true);
public static function useYearsOverflow($yearsOverflow = true);
public function utc();
public function utcOffset(int $offset = null);
public function valueOf();
public function week($week = null, $dayOfWeek = null, $dayOfYear = null);
public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null);
public function weekday($value = null);
public function weeksInYear($dayOfWeek = null, $dayOfYear = null);
public static function yesterday($tz = null);
//
}
src/Carbon/CarbonInterval.php 0000644 00000116405 15014555553 0012200 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon;
use BadMethodCallException;
use Carbon\Traits\Options;
use Closure;
use DateInterval;
use InvalidArgumentException;
use ReflectionClass;
use ReflectionMethod;
/**
* A simple API extension for DateInterval.
* The implementation provides helpers to handle weeks but only days are saved.
* Weeks are calculated based on the total days of the current instance.
*
* @property int $years Total years of the current interval.
* @property int $months Total months of the current interval.
* @property int $weeks Total weeks of the current interval calculated from the days.
* @property int $dayz Total days of the current interval (weeks * 7 + days).
* @property int $hours Total hours of the current interval.
* @property int $minutes Total minutes of the current interval.
* @property int $seconds Total seconds of the current interval.
* @property int $microseconds Total microseconds of the current interval.
* @property int $milliseconds Total microseconds of the current interval.
* @property-read int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7).
* @property-read int $daysExcludeWeeks alias of dayzExcludeWeeks
* @property-read float $totalYears Number of years equivalent to the interval.
* @property-read float $totalMonths Number of months equivalent to the interval.
* @property-read float $totalWeeks Number of weeks equivalent to the interval.
* @property-read float $totalDays Number of days equivalent to the interval.
* @property-read float $totalDayz Alias for totalDays.
* @property-read float $totalHours Number of hours equivalent to the interval.
* @property-read float $totalMinutes Number of minutes equivalent to the interval.
* @property-read float $totalSeconds Number of seconds equivalent to the interval.
* @property-read float $totalMilliseconds Number of milliseconds equivalent to the interval.
* @property-read float $totalMicroseconds Number of microseconds equivalent to the interval.
*
* @method static CarbonInterval years($years = 1) Create instance specifying a number of years.
* @method static CarbonInterval year($years = 1) Alias for years()
* @method static CarbonInterval months($months = 1) Create instance specifying a number of months.
* @method static CarbonInterval month($months = 1) Alias for months()
* @method static CarbonInterval weeks($weeks = 1) Create instance specifying a number of weeks.
* @method static CarbonInterval week($weeks = 1) Alias for weeks()
* @method static CarbonInterval days($days = 1) Create instance specifying a number of days.
* @method static CarbonInterval dayz($days = 1) Alias for days()
* @method static CarbonInterval day($days = 1) Alias for days()
* @method static CarbonInterval hours($hours = 1) Create instance specifying a number of hours.
* @method static CarbonInterval hour($hours = 1) Alias for hours()
* @method static CarbonInterval minutes($minutes = 1) Create instance specifying a number of minutes.
* @method static CarbonInterval minute($minutes = 1) Alias for minutes()
* @method static CarbonInterval seconds($seconds = 1) Create instance specifying a number of seconds.
* @method static CarbonInterval second($seconds = 1) Alias for seconds()
* @method static CarbonInterval milliseconds($milliseconds = 1) Create instance specifying a number of milliseconds.
* @method static CarbonInterval millisecond($milliseconds = 1) Alias for milliseconds()
* @method static CarbonInterval microseconds($microseconds = 1) Create instance specifying a number of microseconds.
* @method static CarbonInterval microsecond($microseconds = 1) Alias for microseconds()
* @method CarbonInterval years($years = 1) Set the years portion of the current interval.
* @method CarbonInterval year($years = 1) Alias for years().
* @method CarbonInterval months($months = 1) Set the months portion of the current interval.
* @method CarbonInterval month($months = 1) Alias for months().
* @method CarbonInterval weeks($weeks = 1) Set the weeks portion of the current interval. Will overwrite dayz value.
* @method CarbonInterval week($weeks = 1) Alias for weeks().
* @method CarbonInterval days($days = 1) Set the days portion of the current interval.
* @method CarbonInterval dayz($days = 1) Alias for days().
* @method CarbonInterval day($days = 1) Alias for days().
* @method CarbonInterval hours($hours = 1) Set the hours portion of the current interval.
* @method CarbonInterval hour($hours = 1) Alias for hours().
* @method CarbonInterval minutes($minutes = 1) Set the minutes portion of the current interval.
* @method CarbonInterval minute($minutes = 1) Alias for minutes().
* @method CarbonInterval seconds($seconds = 1) Set the seconds portion of the current interval.
* @method CarbonInterval second($seconds = 1) Alias for seconds().
* @method CarbonInterval milliseconds($seconds = 1) Set the seconds portion of the current interval.
* @method CarbonInterval millisecond($seconds = 1) Alias for seconds().
* @method CarbonInterval microseconds($seconds = 1) Set the seconds portion of the current interval.
* @method CarbonInterval microsecond($seconds = 1) Alias for seconds().
*/
class CarbonInterval extends DateInterval
{
use Options;
/**
* Interval spec period designators
*/
const PERIOD_PREFIX = 'P';
const PERIOD_YEARS = 'Y';
const PERIOD_MONTHS = 'M';
const PERIOD_DAYS = 'D';
const PERIOD_TIME_PREFIX = 'T';
const PERIOD_HOURS = 'H';
const PERIOD_MINUTES = 'M';
const PERIOD_SECONDS = 'S';
/**
* A translator to ... er ... translate stuff
*
* @var \Symfony\Component\Translation\TranslatorInterface
*/
protected static $translator;
/**
* @var array|null
*/
protected static $cascadeFactors;
/**
* @var array|null
*/
private static $flipCascadeFactors;
/**
* The registered macros.
*
* @var array
*/
protected static $macros = [];
/**
* Mapping of units and factors for cascading.
*
* Should only be modified by changing the factors or referenced constants.
*
* @return array
*/
public static function getCascadeFactors()
{
return static::$cascadeFactors ?: [
'milliseconds' => [1000, 'microseconds'],
'seconds' => [1000, 'milliseconds'],
'minutes' => [Carbon::SECONDS_PER_MINUTE, 'seconds'],
'hours' => [Carbon::MINUTES_PER_HOUR, 'minutes'],
'dayz' => [Carbon::HOURS_PER_DAY, 'hours'],
'months' => [Carbon::DAYS_PER_WEEK * Carbon::WEEKS_PER_MONTH, 'dayz'],
'years' => [Carbon::MONTHS_PER_YEAR, 'months'],
];
}
private static function standardizeUnit($unit)
{
$unit = rtrim($unit, 'sz').'s';
return $unit === 'days' ? 'dayz' : $unit;
}
private static function getFlipCascadeFactors()
{
if (!self::$flipCascadeFactors) {
self::$flipCascadeFactors = [];
foreach (static::getCascadeFactors() as $to => $tuple) {
list($factor, $from) = $tuple;
self::$flipCascadeFactors[self::standardizeUnit($from)] = [self::standardizeUnit($to), $factor];
}
}
return self::$flipCascadeFactors;
}
/**
* @param array $cascadeFactors
*/
public static function setCascadeFactors(array $cascadeFactors)
{
self::$flipCascadeFactors = null;
static::$cascadeFactors = $cascadeFactors;
}
///////////////////////////////////////////////////////////////////
//////////////////////////// CONSTRUCTORS /////////////////////////
///////////////////////////////////////////////////////////////////
/**
* Create a new CarbonInterval instance.
*
* @param int $years
* @param int $months
* @param int $weeks
* @param int $days
* @param int $hours
* @param int $minutes
* @param int $seconds
* @param int $microseconds
*/
public function __construct($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null, $microseconds = null)
{
$spec = $years;
if (!is_string($spec) || floatval($years) || preg_match('/^[0-9.]/', $years)) {
$spec = static::PERIOD_PREFIX;
$spec .= $years > 0 ? $years.static::PERIOD_YEARS : '';
$spec .= $months > 0 ? $months.static::PERIOD_MONTHS : '';
$specDays = 0;
$specDays += $weeks > 0 ? $weeks * static::getDaysPerWeek() : 0;
$specDays += $days > 0 ? $days : 0;
$spec .= $specDays > 0 ? $specDays.static::PERIOD_DAYS : '';
if ($hours > 0 || $minutes > 0 || $seconds > 0) {
$spec .= static::PERIOD_TIME_PREFIX;
$spec .= $hours > 0 ? $hours.static::PERIOD_HOURS : '';
$spec .= $minutes > 0 ? $minutes.static::PERIOD_MINUTES : '';
$spec .= $seconds > 0 ? $seconds.static::PERIOD_SECONDS : '';
}
if ($spec === static::PERIOD_PREFIX) {
// Allow the zero interval.
$spec .= '0'.static::PERIOD_YEARS;
}
}
parent::__construct($spec);
if (!is_null($microseconds)) {
$this->f = $microseconds;
}
}
/**
* Returns the factor for a given source-to-target couple.
*
* @param string $source
* @param string $target
*
* @return int|null
*/
public static function getFactor($source, $target)
{
$source = self::standardizeUnit($source);
$target = self::standardizeUnit($target);
$factors = static::getFlipCascadeFactors();
if (isset($factors[$source])) {
list($to, $factor) = $factors[$source];
if ($to === $target) {
return $factor;
}
}
return null;
}
/**
* Returns current config for days per week.
*
* @return int
*/
public static function getDaysPerWeek()
{
return static::getFactor('dayz', 'weeks') ?: Carbon::DAYS_PER_WEEK;
}
/**
* Returns current config for hours per day.
*
* @return int
*/
public static function getHoursPerDay()
{
return static::getFactor('hours', 'dayz') ?: Carbon::HOURS_PER_DAY;
}
/**
* Returns current config for minutes per hour.
*
* @return int
*/
public static function getMinutesPerHour()
{
return static::getFactor('minutes', 'hours') ?: Carbon::MINUTES_PER_HOUR;
}
/**
* Returns current config for seconds per minute.
*
* @return int
*/
public static function getSecondsPerMinute()
{
return static::getFactor('seconds', 'minutes') ?: Carbon::SECONDS_PER_MINUTE;
}
/**
* Returns current config for microseconds per second.
*
* @return int
*/
public static function getMillisecondsPerSecond()
{
return static::getFactor('milliseconds', 'seconds') ?: 1000;
}
/**
* Returns current config for microseconds per second.
*
* @return int
*/
public static function getMicrosecondsPerMillisecond()
{
return static::getFactor('microseconds', 'milliseconds') ?: 1000;
}
/**
* Create a new CarbonInterval instance from specific values.
* This is an alias for the constructor that allows better fluent
* syntax as it allows you to do CarbonInterval::create(1)->fn() rather than
* (new CarbonInterval(1))->fn().
*
* @param int $years
* @param int $months
* @param int $weeks
* @param int $days
* @param int $hours
* @param int $minutes
* @param int $seconds
*
* @return static
*/
public static function create($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null)
{
return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds);
}
/**
* Get a copy of the instance.
*
* @return static
*/
public function copy()
{
$date = new static($this->spec());
$date->invert = $this->invert;
return $date;
}
/**
* Provide static helpers to create instances. Allows CarbonInterval::years(3).
*
* Note: This is done using the magic method to allow static and instance methods to
* have the same names.
*
* @param string $method magic method name called
* @param array $parameters parameters list
*
* @return static|null
*/
public static function __callStatic($method, $parameters)
{
$arg = count($parameters) === 0 ? 1 : $parameters[0];
switch (Carbon::singularUnit(rtrim($method, 'z'))) {
case 'year':
return new static($arg);
case 'month':
return new static(null, $arg);
case 'week':
return new static(null, null, $arg);
case 'day':
return new static(null, null, null, $arg);
case 'hour':
return new static(null, null, null, null, $arg);
case 'minute':
return new static(null, null, null, null, null, $arg);
case 'second':
return new static(null, null, null, null, null, null, $arg);
case 'millisecond':
case 'milli':
return new static(null, null, null, null, null, null, null, $arg * 1000);
case 'microsecond':
case 'micro':
return new static(null, null, null, null, null, null, null, $arg);
}
if (static::hasMacro($method)) {
return (new static(0))->$method(...$parameters);
}
if (Carbon::isStrictModeEnabled()) {
throw new BadMethodCallException(sprintf("Unknown fluent constructor '%s'.", $method));
}
return null;
}
/**
* Creates a CarbonInterval from string.
*
* Format:
*
* Suffix | Unit | Example | DateInterval expression
* -------|---------|---------|------------------------
* y | years | 1y | P1Y
* mo | months | 3mo | P3M
* w | weeks | 2w | P2W
* d | days | 28d | P28D
* h | hours | 4h | PT4H
* m | minutes | 12m | PT12M
* s | seconds | 59s | PT59S
*
* e. g. `1w 3d 4h 32m 23s` is converted to 10 days 4 hours 32 minutes and 23 seconds.
*
* Special cases:
* - An empty string will return a zero interval
* - Fractions are allowed for weeks, days, hours and minutes and will be converted
* and rounded to the next smaller value (caution: 0.5w = 4d)
*
* @param string $intervalDefinition
*
* @return static
*/
public static function fromString($intervalDefinition)
{
if (empty($intervalDefinition)) {
return new static(0);
}
$years = 0;
$months = 0;
$weeks = 0;
$days = 0;
$hours = 0;
$minutes = 0;
$seconds = 0;
$milliseconds = 0;
$microseconds = 0;
$pattern = '/(\d+(?:\.\d+)?)\h*([^\d\h]*)/i';
preg_match_all($pattern, $intervalDefinition, $parts, PREG_SET_ORDER);
while ($match = array_shift($parts)) {
list($part, $value, $unit) = $match;
$intValue = intval($value);
$fraction = floatval($value) - $intValue;
// Fix calculation precision
switch (round($fraction, 6)) {
case 1:
$fraction = 0;
$intValue++;
break;
case 0:
$fraction = 0;
break;
}
switch ($unit === 'µs' ? 'µs' : strtolower($unit)) {
case 'year':
case 'years':
case 'y':
$years += $intValue;
break;
case 'month':
case 'months':
case 'mo':
$months += $intValue;
break;
case 'week':
case 'weeks':
case 'w':
$weeks += $intValue;
if ($fraction) {
$parts[] = [null, $fraction * static::getDaysPerWeek(), 'd'];
}
break;
case 'day':
case 'days':
case 'd':
$days += $intValue;
if ($fraction) {
$parts[] = [null, $fraction * static::getHoursPerDay(), 'h'];
}
break;
case 'hour':
case 'hours':
case 'h':
$hours += $intValue;
if ($fraction) {
$parts[] = [null, $fraction * static::getMinutesPerHour(), 'm'];
}
break;
case 'minute':
case 'minutes':
case 'm':
$minutes += $intValue;
if ($fraction) {
$parts[] = [null, $fraction * static::getSecondsPerMinute(), 's'];
}
break;
case 'second':
case 'seconds':
case 's':
$seconds += $intValue;
if ($fraction) {
$parts[] = [null, $fraction * static::getMillisecondsPerSecond(), 'ms'];
}
break;
case 'millisecond':
case 'milliseconds':
case 'milli':
case 'ms':
$milliseconds += $intValue;
if ($fraction) {
$microseconds += round($fraction * static::getMicrosecondsPerMillisecond());
}
break;
case 'microsecond':
case 'microseconds':
case 'micro':
case 'µs':
$microseconds += $intValue;
break;
default:
throw new InvalidArgumentException(
sprintf('Invalid part %s in definition %s', $part, $intervalDefinition)
);
}
}
return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds, $milliseconds * 1000 + $microseconds);
}
/**
* Create a CarbonInterval instance from a DateInterval one. Can not instance
* DateInterval objects created from DateTime::diff() as you can't externally
* set the $days field.
*
* @param DateInterval $di
*
* @return static
*/
public static function instance(DateInterval $di)
{
$instance = new static(static::getDateIntervalSpec($di));
$instance->invert = $di->invert;
foreach (['y', 'm', 'd', 'h', 'i', 's'] as $unit) {
if ($di->$unit < 0) {
$instance->$unit *= -1;
}
}
return $instance;
}
/**
* Make a CarbonInterval instance from given variable if possible.
*
* Always return a new instance. Parse only strings and only these likely to be intervals (skip dates
* and recurrences). Throw an exception for invalid format, but otherwise return null.
*
* @param mixed $var
*
* @return static|null
*/
public static function make($var)
{
if ($var instanceof DateInterval) {
return static::instance($var);
}
if (!is_string($var)) {
return null;
}
$var = trim($var);
if (preg_match('/^P[T0-9]/', $var)) {
return new static($var);
}
if (preg_match('/^(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+$/i', $var)) {
return static::fromString($var);
}
/** @var static $interval */
$interval = static::createFromDateString($var);
return $interval->isEmpty() ? null : $interval;
}
/**
* Sets up a DateInterval from the relative parts of the string.
*
* @param string $time
*
* @return static
*
* @link http://php.net/manual/en/dateinterval.createfromdatestring.php
*/
public static function createFromDateString($time)
{
$interval = parent::createFromDateString($time);
if ($interval instanceof DateInterval && !($interval instanceof static)) {
$interval = static::instance($interval);
}
return static::instance($interval);
}
///////////////////////////////////////////////////////////////////
///////////////////////// GETTERS AND SETTERS /////////////////////
///////////////////////////////////////////////////////////////////
/**
* Get a part of the CarbonInterval object.
*
* @param string $name
*
* @throws \InvalidArgumentException
*
* @return int|float
*/
public function __get($name)
{
if (substr($name, 0, 5) === 'total') {
return $this->total(substr($name, 5));
}
switch ($name) {
case 'years':
return $this->y;
case 'months':
return $this->m;
case 'dayz':
return $this->d;
case 'hours':
return $this->h;
case 'minutes':
return $this->i;
case 'seconds':
return $this->s;
case 'milli':
case 'milliseconds':
return (int) floor($this->f / 1000);
case 'micro':
case 'microseconds':
return (int) $this->f;
case 'weeks':
return (int) floor($this->d / static::getDaysPerWeek());
case 'daysExcludeWeeks':
case 'dayzExcludeWeeks':
return $this->d % static::getDaysPerWeek();
default:
throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name));
}
}
/**
* Set a part of the CarbonInterval object.
*
* @param string $name
* @param int $value
*
* @throws \InvalidArgumentException
*/
public function __set($name, $value)
{
switch (Carbon::singularUnit(rtrim($name, 'z'))) {
case 'year':
$this->y = $value;
break;
case 'month':
$this->m = $value;
break;
case 'week':
$this->d = $value * static::getDaysPerWeek();
break;
case 'day':
$this->d = $value;
break;
case 'hour':
$this->h = $value;
break;
case 'minute':
$this->i = $value;
break;
case 'second':
$this->s = $value;
break;
case 'milli':
case 'millisecond':
$this->f = $value * 1000 + $this->f % 1000;
break;
case 'micro':
case 'microsecond':
$this->f = $value;
break;
default:
if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) {
throw new InvalidArgumentException(sprintf("Unknown setter '%s'", $name));
}
$this->$name = $value;
}
}
/**
* Allow setting of weeks and days to be cumulative.
*
* @param int $weeks Number of weeks to set
* @param int $days Number of days to set
*
* @return static
*/
public function weeksAndDays($weeks, $days)
{
$this->dayz = ($weeks * static::getDaysPerWeek()) + $days;
return $this;
}
/**
* Returns true if the interval is empty for each unit.
*
* @return bool
*/
public function isEmpty()
{
return $this->years === 0 &&
$this->months === 0 &&
$this->dayz === 0 &&
!$this->days &&
$this->hours === 0 &&
$this->minutes === 0 &&
$this->seconds === 0 &&
$this->microseconds === 0;
}
/**
* Register a custom macro.
*
* @param string $name
* @param object|callable $macro
*
* @return void
*/
public static function macro($name, $macro)
{
static::$macros[$name] = $macro;
}
/**
* Register macros from a mixin object.
*
* @param object $mixin
*
* @throws \ReflectionException
*
* @return void
*/
public static function mixin($mixin)
{
$reflection = new ReflectionClass($mixin);
$methods = $reflection->getMethods(
ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED
);
foreach ($methods as $method) {
$method->setAccessible(true);
static::macro($method->name, $method->invoke($mixin));
}
}
/**
* Check if macro is registered.
*
* @param string $name
*
* @return bool
*/
public static function hasMacro($name)
{
return isset(static::$macros[$name]);
}
/**
* Call given macro.
*
* @param string $name
* @param array $parameters
*
* @return mixed
*/
protected function callMacro($name, $parameters)
{
$macro = static::$macros[$name];
if ($macro instanceof Closure) {
return call_user_func_array($macro->bindTo($this, static::class), $parameters);
}
return call_user_func_array($macro, $parameters);
}
/**
* Allow fluent calls on the setters... CarbonInterval::years(3)->months(5)->day().
*
* Note: This is done using the magic method to allow static and instance methods to
* have the same names.
*
* @param string $method magic method name called
* @param array $parameters parameters list
*
* @return static
*/
public function __call($method, $parameters)
{
if (static::hasMacro($method)) {
return $this->callMacro($method, $parameters);
}
$arg = count($parameters) === 0 ? 1 : $parameters[0];
switch (Carbon::singularUnit(rtrim($method, 'z'))) {
case 'year':
$this->years = $arg;
break;
case 'month':
$this->months = $arg;
break;
case 'week':
$this->dayz = $arg * static::getDaysPerWeek();
break;
case 'day':
$this->dayz = $arg;
break;
case 'hour':
$this->hours = $arg;
break;
case 'minute':
$this->minutes = $arg;
break;
case 'second':
$this->seconds = $arg;
break;
case 'milli':
case 'millisecond':
$this->milliseconds = $arg;
break;
case 'micro':
case 'microsecond':
$this->microseconds = $arg;
break;
default:
if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) {
throw new BadMethodCallException(sprintf("Unknown fluent setter '%s'", $method));
}
}
return $this;
}
/**
* Get the current interval in a human readable format in the current locale.
*
* @param int $syntax add modifiers:
* Possible values:
* - CarbonInterface::DIFF_ABSOLUTE no modifiers
* - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier
* - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier
* Default value: CarbonInterface::DIFF_ABSOLUTE
* @param bool $short displays short format of time units
* @param int $parts maximum number of parts to display (default value: -1: no limits)
* @param int $options human diff options
*
* @return string
*/
public function forHumans($syntax = null, $short = false, $parts = -1, $options = null)
{
if (is_int($short)) {
$parts = $short;
$short = false;
}
if (is_bool($syntax)) {
$short = $syntax;
$syntax = CarbonInterface::DIFF_ABSOLUTE;
}
if (is_null($syntax)) {
$syntax = CarbonInterface::DIFF_ABSOLUTE;
}
if ($parts === -1) {
$parts = INF;
}
if (is_null($options)) {
$options = static::getHumanDiffOptions();
}
$interval = [];
$syntax = (int) ($syntax === null ? CarbonInterface::DIFF_ABSOLUTE : $syntax);
$absolute = $syntax === CarbonInterface::DIFF_ABSOLUTE;
$relativeToNow = $syntax === CarbonInterface::DIFF_RELATIVE_TO_NOW;
$count = 1;
$unit = $short ? 's' : 'second';
/** @var \Symfony\Component\Translation\Translator $translator */
$translator = $this->getLocalTranslator();
$diffIntervalArray = [
['value' => $this->years, 'unit' => 'year', 'unitShort' => 'y'],
['value' => $this->months, 'unit' => 'month', 'unitShort' => 'm'],
['value' => $this->weeks, 'unit' => 'week', 'unitShort' => 'w'],
['value' => $this->daysExcludeWeeks, 'unit' => 'day', 'unitShort' => 'd'],
['value' => $this->hours, 'unit' => 'hour', 'unitShort' => 'h'],
['value' => $this->minutes, 'unit' => 'minute', 'unitShort' => 'min'],
['value' => $this->seconds, 'unit' => 'second', 'unitShort' => 's'],
];
$transChoice = function ($short, $unitData) use ($translator) {
$count = $unitData['value'];
if ($short) {
$result = $translator->transChoice($unitData['unitShort'], $count, [':count' => $count]);
if ($result !== $unitData['unitShort']) {
return $result;
}
}
return $translator->transChoice($unitData['unit'], $count, [':count' => $count]);
};
foreach ($diffIntervalArray as $diffIntervalData) {
if ($diffIntervalData['value'] > 0) {
$unit = $short ? $diffIntervalData['unitShort'] : $diffIntervalData['unit'];
$count = $diffIntervalData['value'];
$interval[] = $transChoice($short, $diffIntervalData);
}
// break the loop after we get the required number of parts in array
if (count($interval) >= $parts) {
break;
}
}
if (count($interval) === 0) {
if ($relativeToNow && $options & CarbonInterface::JUST_NOW) {
$key = 'diff_now';
$translation = $translator->trans($key);
if ($translation !== $key) {
return $translation;
}
}
$count = $options & CarbonInterface::NO_ZERO_DIFF ? 1 : 0;
$unit = $short ? 's' : 'second';
$interval[] = $translator->transChoice($unit, $count, [':count' => $count]);
}
// join the interval parts by a space
$time = implode(' ', $interval);
unset($diffIntervalArray, $interval);
if ($absolute) {
return $time;
}
$isFuture = $this->invert === 1;
$transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before');
if ($parts === 1) {
if ($relativeToNow && $unit === 'day') {
if ($count === 1 && $options & CarbonInterface::ONE_DAY_WORDS) {
$key = $isFuture ? 'diff_tomorrow' : 'diff_yesterday';
$translation = $translator->trans($key);
if ($translation !== $key) {
return $translation;
}
}
if ($count === 2 && $options & CarbonInterface::TWO_DAY_WORDS) {
$key = $isFuture ? 'diff_after_tomorrow' : 'diff_before_yesterday';
$translation = $translator->trans($key);
if ($translation !== $key) {
return $translation;
}
}
}
// Some languages have special pluralization for past and future tense.
$key = $unit.'_'.$transId;
if ($key !== $translator->transChoice($key, $count)) {
$time = $translator->transChoice($key, $count, [':count' => $count]);
}
}
return $translator->trans($transId, [':time' => $time]);
}
/**
* Format the instance as a string using the forHumans() function.
*
* @return string
*/
public function __toString()
{
return $this->forHumans();
}
/**
* Convert the interval to a CarbonPeriod.
*
* @return CarbonPeriod
*/
public function toPeriod(...$params)
{
return CarbonPeriod::create($this, ...$params);
}
/**
* Invert the interval.
*
* @return $this
*/
public function invert()
{
$this->invert = $this->invert ? 0 : 1;
return $this;
}
/**
* Add the passed interval to the current instance.
*
* @param DateInterval $interval
*
* @return static
*/
public function add(DateInterval $interval)
{
$sign = $interval->invert === 1 ? -1 : 1;
$this->years += $interval->y * $sign;
$this->months += $interval->m * $sign;
$this->dayz += ($interval->days === false ? $interval->d : $interval->days) * $sign;
$this->hours += $interval->h * $sign;
$this->minutes += $interval->i * $sign;
$this->seconds += $interval->s * $sign;
return $this;
}
/**
* Multiply current instance given number of times
*
* @param float $factor
*
* @return $this
*/
public function times($factor)
{
if ($factor < 0) {
$this->invert = $this->invert ? 0 : 1;
$factor = -$factor;
}
$this->years = (int) round($this->years * $factor);
$this->months = (int) round($this->months * $factor);
$this->dayz = (int) round($this->dayz * $factor);
$this->hours = (int) round($this->hours * $factor);
$this->minutes = (int) round($this->minutes * $factor);
$this->seconds = (int) round($this->seconds * $factor);
$this->microseconds = (int) round($this->microseconds * $factor);
return $this;
}
/**
* Get the interval_spec string of a date interval.
*
* @param DateInterval $interval
*
* @return string
*/
public static function getDateIntervalSpec(DateInterval $interval)
{
$date = array_filter([
static::PERIOD_YEARS => abs($interval->y),
static::PERIOD_MONTHS => abs($interval->m),
static::PERIOD_DAYS => abs($interval->d),
]);
$time = array_filter([
static::PERIOD_HOURS => abs($interval->h),
static::PERIOD_MINUTES => abs($interval->i),
static::PERIOD_SECONDS => abs($interval->s),
]);
$specString = static::PERIOD_PREFIX;
foreach ($date as $key => $value) {
$specString .= $value.$key;
}
if (count($time) > 0) {
$specString .= static::PERIOD_TIME_PREFIX;
foreach ($time as $key => $value) {
$specString .= $value.$key;
}
}
return $specString === static::PERIOD_PREFIX ? 'PT0S' : $specString;
}
/**
* Get the interval_spec string.
*
* @return string
*/
public function spec()
{
return static::getDateIntervalSpec($this);
}
/**
* Comparing 2 date intervals.
*
* @param DateInterval $a
* @param DateInterval $b
*
* @return int
*/
public static function compareDateIntervals(DateInterval $a, DateInterval $b)
{
$current = Carbon::now();
$passed = $current->copy()->add($b);
$current->add($a);
if ($current < $passed) {
return -1;
}
if ($current > $passed) {
return 1;
}
return 0;
}
/**
* Comparing with passed interval.
*
* @param DateInterval $interval
*
* @return int
*/
public function compare(DateInterval $interval)
{
return static::compareDateIntervals($this, $interval);
}
/**
* Convert overflowed values into bigger units.
*
* @return $this
*/
public function cascade()
{
foreach (static::getFlipCascadeFactors() as $source => $cascade) {
list($target, $factor) = $cascade;
if ($source === 'dayz' && $target === 'weeks') {
continue;
}
$value = $this->$source;
$this->$source = $modulo = $value % $factor;
$this->$target += ($value - $modulo) / $factor;
}
return $this;
}
/**
* Get amount of given unit equivalent to the interval.
*
* @param string $unit
*
* @throws \InvalidArgumentException
*
* @return float
*/
public function total($unit)
{
$realUnit = $unit = strtolower($unit);
if (in_array($unit, ['days', 'weeks'])) {
$realUnit = 'dayz';
} elseif (!in_array($unit, ['seconds', 'minutes', 'hours', 'dayz', 'months', 'years'])) {
throw new InvalidArgumentException("Unknown unit '$unit'.");
}
$result = 0;
$cumulativeFactor = 0;
$unitFound = false;
foreach (static::getFlipCascadeFactors() as $source => $cascade) {
list($target, $factor) = $cascade;
if ($source === $realUnit) {
$unitFound = true;
$result += $this->$source;
$cumulativeFactor = 1;
}
if ($factor === false) {
if ($unitFound) {
break;
}
$result = 0;
$cumulativeFactor = 0;
continue;
}
if ($target === $realUnit) {
$unitFound = true;
}
if ($cumulativeFactor) {
$cumulativeFactor *= $factor;
$result += $this->$target * $cumulativeFactor;
continue;
}
$result = ($result + $this->$source) / $factor;
}
if (isset($target) && !$cumulativeFactor) {
$result += $this->$target;
}
if (!$unitFound) {
throw new \InvalidArgumentException("Unit $unit have no configuration to get total from other units.");
}
if ($unit === 'weeks') {
return $result / static::getDaysPerWeek();
}
return $result;
}
}
src/Carbon/CarbonPeriod.php 0000644 00000116627 15014555553 0011644 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon;
use BadMethodCallException;
use Carbon\Traits\Options;
use Closure;
use Countable;
use DateInterval;
use DateTime;
use DateTimeInterface;
use InvalidArgumentException;
use Iterator;
use ReflectionClass;
use ReflectionMethod;
use RuntimeException;
/**
* Substitution of DatePeriod with some modifications and many more features.
*
* @method static CarbonPeriod start($date, $inclusive = null) Create instance specifying start date.
* @method static CarbonPeriod since($date, $inclusive = null) Alias for start().
* @method static CarbonPeriod sinceNow($inclusive = null) Create instance with start date set to now.
* @method static CarbonPeriod end($date = null, $inclusive = null) Create instance specifying end date.
* @method static CarbonPeriod until($date = null, $inclusive = null) Alias for end().
* @method static CarbonPeriod untilNow($inclusive = null) Create instance with end date set to now.
* @method static CarbonPeriod dates($start, $end = null) Create instance with start and end date.
* @method static CarbonPeriod between($start, $end = null) Create instance with start and end date.
* @method static CarbonPeriod recurrences($recurrences = null) Create instance with maximum number of recurrences.
* @method static CarbonPeriod times($recurrences = null) Alias for recurrences().
* @method static CarbonPeriod options($options = null) Create instance with options.
* @method static CarbonPeriod toggle($options, $state = null) Create instance with options toggled on or off.
* @method static CarbonPeriod filter($callback, $name = null) Create instance with filter added to the stack.
* @method static CarbonPeriod push($callback, $name = null) Alias for filter().
* @method static CarbonPeriod prepend($callback, $name = null) Create instance with filter prepened to the stack.
* @method static CarbonPeriod filters(array $filters) Create instance with filters stack.
* @method static CarbonPeriod interval($interval) Create instance with given date interval.
* @method static CarbonPeriod each($interval) Create instance with given date interval.
* @method static CarbonPeriod every($interval) Create instance with given date interval.
* @method static CarbonPeriod step($interval) Create instance with given date interval.
* @method static CarbonPeriod stepBy($interval) Create instance with given date interval.
* @method static CarbonPeriod invert() Create instance with inverted date interval.
* @method static CarbonPeriod years($years = 1) Create instance specifying a number of years for date interval.
* @method static CarbonPeriod year($years = 1) Alias for years().
* @method static CarbonPeriod months($months = 1) Create instance specifying a number of months for date interval.
* @method static CarbonPeriod month($months = 1) Alias for months().
* @method static CarbonPeriod weeks($weeks = 1) Create instance specifying a number of weeks for date interval.
* @method static CarbonPeriod week($weeks = 1) Alias for weeks().
* @method static CarbonPeriod days($days = 1) Create instance specifying a number of days for date interval.
* @method static CarbonPeriod dayz($days = 1) Alias for days().
* @method static CarbonPeriod day($days = 1) Alias for days().
* @method static CarbonPeriod hours($hours = 1) Create instance specifying a number of hours for date interval.
* @method static CarbonPeriod hour($hours = 1) Alias for hours().
* @method static CarbonPeriod minutes($minutes = 1) Create instance specifying a number of minutes for date interval.
* @method static CarbonPeriod minute($minutes = 1) Alias for minutes().
* @method static CarbonPeriod seconds($seconds = 1) Create instance specifying a number of seconds for date interval.
* @method static CarbonPeriod second($seconds = 1) Alias for seconds().
* @method CarbonPeriod start($date, $inclusive = null) Change the period start date.
* @method CarbonPeriod since($date, $inclusive = null) Alias for start().
* @method CarbonPeriod sinceNow($inclusive = null) Change the period start date to now.
* @method CarbonPeriod end($date = null, $inclusive = null) Change the period end date.
* @method CarbonPeriod until($date = null, $inclusive = null) Alias for end().
* @method CarbonPeriod untilNow($inclusive = null) Change the period end date to now.
* @method CarbonPeriod dates($start, $end = null) Change the period start and end date.
* @method CarbonPeriod recurrences($recurrences = null) Change the maximum number of recurrences.
* @method CarbonPeriod times($recurrences = null) Alias for recurrences().
* @method CarbonPeriod options($options = null) Change the period options.
* @method CarbonPeriod toggle($options, $state = null) Toggle given options on or off.
* @method CarbonPeriod filter($callback, $name = null) Add a filter to the stack.
* @method CarbonPeriod push($callback, $name = null) Alias for filter().
* @method CarbonPeriod prepend($callback, $name = null) Prepend a filter to the stack.
* @method CarbonPeriod filters(array $filters = []) Set filters stack.
* @method CarbonPeriod interval($interval) Change the period date interval.
* @method CarbonPeriod invert() Invert the period date interval.
* @method CarbonPeriod years($years = 1) Set the years portion of the date interval.
* @method CarbonPeriod year($years = 1) Alias for years().
* @method CarbonPeriod months($months = 1) Set the months portion of the date interval.
* @method CarbonPeriod month($months = 1) Alias for months().
* @method CarbonPeriod weeks($weeks = 1) Set the weeks portion of the date interval.
* @method CarbonPeriod week($weeks = 1) Alias for weeks().
* @method CarbonPeriod days($days = 1) Set the days portion of the date interval.
* @method CarbonPeriod dayz($days = 1) Alias for days().
* @method CarbonPeriod day($days = 1) Alias for days().
* @method CarbonPeriod hours($hours = 1) Set the hours portion of the date interval.
* @method CarbonPeriod hour($hours = 1) Alias for hours().
* @method CarbonPeriod minutes($minutes = 1) Set the minutes portion of the date interval.
* @method CarbonPeriod minute($minutes = 1) Alias for minutes().
* @method CarbonPeriod seconds($seconds = 1) Set the seconds portion of the date interval.
* @method CarbonPeriod second($seconds = 1) Alias for seconds().
*/
class CarbonPeriod implements Iterator, Countable
{
use Options;
/**
* Built-in filters.
*
* @var string
*/
const RECURRENCES_FILTER = 'Carbon\CarbonPeriod::filterRecurrences';
const END_DATE_FILTER = 'Carbon\CarbonPeriod::filterEndDate';
/**
* Special value which can be returned by filters to end iteration. Also a filter.
*
* @var string
*/
const END_ITERATION = 'Carbon\CarbonPeriod::endIteration';
/**
* Available options.
*
* @var int
*/
const EXCLUDE_START_DATE = 1;
const EXCLUDE_END_DATE = 2;
const IMMUTABLE = 4;
/**
* Number of maximum attempts before giving up on finding next valid date.
*
* @var int
*/
const NEXT_MAX_ATTEMPTS = 1000;
/**
* The registered macros.
*
* @var array
*/
protected static $macros = [];
/**
* Date class of iteration items.
*
* @var string
*/
protected $dateClass = Carbon::class;
/**
* Underlying date interval instance. Always present, one day by default.
*
* @var CarbonInterval
*/
protected $dateInterval;
/**
* Whether current date interval was set by default.
*
* @var bool
*/
protected $isDefaultInterval;
/**
* The filters stack.
*
* @var array
*/
protected $filters = [];
/**
* Period start date. Applied on rewind. Always present, now by default.
*
* @var CarbonInterface
*/
protected $startDate;
/**
* Period end date. For inverted interval should be before the start date. Applied via a filter.
*
* @var CarbonInterface|null
*/
protected $endDate;
/**
* Limit for number of recurrences. Applied via a filter.
*
* @var int|null
*/
protected $recurrences;
/**
* Iteration options.
*
* @var int
*/
protected $options;
/**
* Index of current date. Always sequential, even if some dates are skipped by filters.
* Equal to null only before the first iteration.
*
* @var int
*/
protected $key;
/**
* Current date. May temporarily hold unaccepted value when looking for a next valid date.
* Equal to null only before the first iteration.
*
* @var CarbonInterface
*/
protected $current;
/**
* Timezone of current date. Taken from the start date.
*
* @var \DateTimeZone|null
*/
protected $timezone;
/**
* The cached validation result for current date.
*
* @var bool|string|null
*/
protected $validationResult;
/**
* Create a new instance.
*
* @return static
*/
public static function create(...$params)
{
return static::createFromArray($params);
}
/**
* Create a new instance from an array of parameters.
*
* @param array $params
*
* @return static
*/
public static function createFromArray(array $params)
{
return new static(...$params);
}
/**
* Create CarbonPeriod from ISO 8601 string.
*
* @param string $iso
* @param int|null $options
*
* @return static
*/
public static function createFromIso($iso, $options = null)
{
$params = static::parseIso8601($iso);
$instance = static::createFromArray($params);
if ($options !== null) {
$instance->setOptions($options);
}
return $instance;
}
/**
* Return whether given interval contains non zero value of any time unit.
*
* @param \DateInterval $interval
*
* @return bool
*/
protected static function intervalHasTime(DateInterval $interval)
{
// The array_key_exists and get_object_vars are used as a workaround to check microsecond support.
// Both isset and property_exists will fail on PHP 7.0.14 - 7.0.21 due to the following bug:
// https://bugs.php.net/bug.php?id=74852
return $interval->h || $interval->i || $interval->s || array_key_exists('f', get_object_vars($interval)) && $interval->f;
}
/**
* Return whether given variable is an ISO 8601 specification.
*
* Note: Check is very basic, as actual validation will be done later when parsing.
* We just want to ensure that variable is not any other type of a valid parameter.
*
* @param mixed $var
*
* @return bool
*/
protected static function isIso8601($var)
{
if (!is_string($var)) {
return false;
}
// Match slash but not within a timezone name.
$part = '[a-z]+(?:[_-][a-z]+)*';
preg_match("#\b$part/$part\b|(/)#i", $var, $match);
return isset($match[1]);
}
/**
* Parse given ISO 8601 string into an array of arguments.
*
* @param string $iso
*
* @return array
*/
protected static function parseIso8601($iso)
{
$result = [];
$interval = null;
$start = null;
$end = null;
foreach (explode('/', $iso) as $key => $part) {
if ($key === 0 && preg_match('/^R([0-9]*)$/', $part, $match)) {
$parsed = strlen($match[1]) ? (int) $match[1] : null;
} elseif ($interval === null && $parsed = CarbonInterval::make($part)) {
$interval = $part;
} elseif ($start === null && $parsed = Carbon::make($part)) {
$start = $part;
} elseif ($end === null && $parsed = Carbon::make(static::addMissingParts($start, $part))) {
$end = $part;
} else {
throw new InvalidArgumentException("Invalid ISO 8601 specification: $iso.");
}
$result[] = $parsed;
}
return $result;
}
/**
* Add missing parts of the target date from the soure date.
*
* @param string $source
* @param string $target
*
* @return string
*/
protected static function addMissingParts($source, $target)
{
$pattern = '/'.preg_replace('/[0-9]+/', '[0-9]+', preg_quote($target, '/')).'$/';
$result = preg_replace($pattern, $target, $source, 1, $count);
return $count ? $result : $target;
}
/**
* Register a custom macro.
*
* @param string $name
* @param object|callable $macro
*
* @return void
*/
public static function macro($name, $macro)
{
static::$macros[$name] = $macro;
}
/**
* Register macros from a mixin object.
*
* @param object $mixin
*
* @throws \ReflectionException
*
* @return void
*/
public static function mixin($mixin)
{
$reflection = new ReflectionClass($mixin);
$methods = $reflection->getMethods(
ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED
);
foreach ($methods as $method) {
$method->setAccessible(true);
static::macro($method->name, $method->invoke($mixin));
}
}
/**
* Check if macro is registered.
*
* @param string $name
*
* @return bool
*/
public static function hasMacro($name)
{
return isset(static::$macros[$name]);
}
/**
* Provide static proxy for instance aliases.
*
* @param string $method
* @param array $parameters
*
* @return mixed
*/
public static function __callStatic($method, $parameters)
{
return (new static)->$method(...$parameters);
}
/**
* CarbonPeriod constructor.
*
* @throws InvalidArgumentException
*/
public function __construct(...$arguments)
{
// Parse and assign arguments one by one. First argument may be an ISO 8601 spec,
// which will be first parsed into parts and then processed the same way.
if (count($arguments) && static::isIso8601($iso = $arguments[0])) {
array_splice($arguments, 0, 1, static::parseIso8601($iso));
}
foreach ($arguments as $argument) {
if ($this->dateInterval === null &&
(
is_string($argument) && preg_match('/^(\d.*|P[T0-9].*|(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+)$/i', $argument) ||
$argument instanceof DateInterval
) &&
$parsed = CarbonInterval::make($argument)
) {
$this->setDateInterval($parsed);
} elseif ($this->startDate === null && $parsed = Carbon::make($argument)) {
$this->setStartDate($parsed);
} elseif ($this->endDate === null && $parsed = Carbon::make($argument)) {
$this->setEndDate($parsed);
} elseif ($this->recurrences === null && $this->endDate === null && is_numeric($argument)) {
$this->setRecurrences($argument);
} elseif ($this->options === null && (is_int($argument) || $argument === null)) {
$this->setOptions($argument);
} else {
throw new InvalidArgumentException('Invalid constructor parameters.');
}
}
if ($this->startDate === null) {
$this->setStartDate(Carbon::now());
}
if ($this->dateInterval === null) {
$this->setDateInterval(CarbonInterval::day());
$this->isDefaultInterval = true;
}
if ($this->options === null) {
$this->setOptions(0);
}
}
/**
* Return whether given callable is a string pointing to one of Carbon's is* methods
* and should be automatically converted to a filter callback.
*
* @param callable $callable
*
* @return bool
*/
protected function isCarbonPredicateMethod($callable)
{
return is_string($callable) && substr($callable, 0, 2) === 'is' && (method_exists($this->dateClass, $callable) || call_user_func([$this->dateClass, 'hasMacro'], $callable));
}
/**
* Set the iteration item class.
*
* @param string $dateClass
*
* @return $this
*/
public function setDateClass(string $dateClass)
{
if (!is_a($dateClass, CarbonInterface::class, true)) {
throw new InvalidArgumentException(sprintf(
'Given class does not implement %s: %s', CarbonInterface::class, $dateClass
));
}
$this->dateClass = $dateClass;
if (is_a($dateClass, Carbon::class, true)) {
$this->toggleOptions(static::IMMUTABLE, false);
} elseif (is_a($dateClass, CarbonImmutable::class, true)) {
$this->toggleOptions(static::IMMUTABLE, true);
}
return $this;
}
/**
* Returns iteration item date class.
*
* @return string
*/
public function getDateClass(): string
{
return $this->dateClass;
}
/**
* Change the period date interval.
*
* @param DateInterval|string $interval
*
* @throws \InvalidArgumentException
*
* @return $this
*/
public function setDateInterval($interval)
{
if (!$interval = CarbonInterval::make($interval)) {
throw new InvalidArgumentException('Invalid interval.');
}
if ($interval->spec() === 'PT0S') {
throw new InvalidArgumentException('Empty interval is not accepted.');
}
$this->dateInterval = $interval;
$this->isDefaultInterval = false;
$this->handleChangedParameters();
return $this;
}
/**
* Invert the period date interval.
*
* @return $this
*/
public function invertDateInterval()
{
$interval = $this->dateInterval->invert();
return $this->setDateInterval($interval);
}
/**
* Set start and end date.
*
* @param DateTime|DateTimeInterface|string $start
* @param DateTime|DateTimeInterface|string|null $end
*
* @return $this
*/
public function setDates($start, $end)
{
$this->setStartDate($start);
$this->setEndDate($end);
return $this;
}
/**
* Change the period options.
*
* @param int|null $options
*
* @throws \InvalidArgumentException
*
* @return $this
*/
public function setOptions($options)
{
if (!is_int($options) && !is_null($options)) {
throw new InvalidArgumentException('Invalid options.');
}
$this->options = $options ?: 0;
$this->handleChangedParameters();
return $this;
}
/**
* Get the period options.
*
* @return int
*/
public function getOptions()
{
return $this->options;
}
/**
* Toggle given options on or off.
*
* @param int $options
* @param bool|null $state
*
* @throws \InvalidArgumentException
*
* @return $this
*/
public function toggleOptions($options, $state = null)
{
if ($state === null) {
$state = ($this->options & $options) !== $options;
}
return $this->setOptions(
$state ?
$this->options | $options :
$this->options & ~$options
);
}
/**
* Toggle EXCLUDE_START_DATE option.
*
* @param bool $state
*
* @return $this
*/
public function excludeStartDate($state = true)
{
return $this->toggleOptions(static::EXCLUDE_START_DATE, $state);
}
/**
* Toggle EXCLUDE_END_DATE option.
*
* @param bool $state
*
* @return $this
*/
public function excludeEndDate($state = true)
{
return $this->toggleOptions(static::EXCLUDE_END_DATE, $state);
}
/**
* Get the underlying date interval.
*
* @return CarbonInterval
*/
public function getDateInterval()
{
return $this->dateInterval->copy();
}
/**
* Get start date of the period.
*
* @return Carbon
*/
public function getStartDate()
{
return $this->startDate->copy();
}
/**
* Get end date of the period.
*
* @return Carbon|null
*/
public function getEndDate()
{
if ($this->endDate) {
return $this->endDate->copy();
}
}
/**
* Get number of recurrences.
*
* @return int|null
*/
public function getRecurrences()
{
return $this->recurrences;
}
/**
* Returns true if the start date should be excluded.
*
* @return bool
*/
public function isStartExcluded()
{
return ($this->options & static::EXCLUDE_START_DATE) !== 0;
}
/**
* Returns true if the end date should be excluded.
*
* @return bool
*/
public function isEndExcluded()
{
return ($this->options & static::EXCLUDE_END_DATE) !== 0;
}
/**
* Add a filter to the stack.
*
* @param callable $callback
* @param string $name
*
* @return $this
*/
public function addFilter($callback, $name = null)
{
$tuple = $this->createFilterTuple(func_get_args());
$this->filters[] = $tuple;
$this->handleChangedParameters();
return $this;
}
/**
* Prepend a filter to the stack.
*
* @param callable $callback
* @param string $name
*
* @return $this
*/
public function prependFilter($callback, $name = null)
{
$tuple = $this->createFilterTuple(func_get_args());
array_unshift($this->filters, $tuple);
$this->handleChangedParameters();
return $this;
}
/**
* Create a filter tuple from raw parameters.
*
* Will create an automatic filter callback for one of Carbon's is* methods.
*
* @param array $parameters
*
* @return array
*/
protected function createFilterTuple(array $parameters)
{
$method = array_shift($parameters);
if (!$this->isCarbonPredicateMethod($method)) {
return [$method, array_shift($parameters)];
}
return [function ($date) use ($method, $parameters) {
return call_user_func_array([$date, $method], $parameters);
}, $method];
}
/**
* Remove a filter by instance or name.
*
* @param callable|string $filter
*
* @return $this
*/
public function removeFilter($filter)
{
$key = is_callable($filter) ? 0 : 1;
$this->filters = array_values(array_filter(
$this->filters,
function ($tuple) use ($key, $filter) {
return $tuple[$key] !== $filter;
}
));
$this->updateInternalState();
$this->handleChangedParameters();
return $this;
}
/**
* Return whether given instance or name is in the filter stack.
*
* @param callable|string $filter
*
* @return bool
*/
public function hasFilter($filter)
{
$key = is_callable($filter) ? 0 : 1;
foreach ($this->filters as $tuple) {
if ($tuple[$key] === $filter) {
return true;
}
}
return false;
}
/**
* Get filters stack.
*
* @return array
*/
public function getFilters()
{
return $this->filters;
}
/**
* Set filters stack.
*
* @param array $filters
*
* @return $this
*/
public function setFilters(array $filters)
{
$this->filters = $filters;
$this->updateInternalState();
$this->handleChangedParameters();
return $this;
}
/**
* Reset filters stack.
*
* @return $this
*/
public function resetFilters()
{
$this->filters = [];
if ($this->endDate !== null) {
$this->filters[] = [static::END_DATE_FILTER, null];
}
if ($this->recurrences !== null) {
$this->filters[] = [static::RECURRENCES_FILTER, null];
}
$this->handleChangedParameters();
return $this;
}
/**
* Update properties after removing built-in filters.
*
* @return void
*/
protected function updateInternalState()
{
if (!$this->hasFilter(static::END_DATE_FILTER)) {
$this->endDate = null;
}
if (!$this->hasFilter(static::RECURRENCES_FILTER)) {
$this->recurrences = null;
}
}
/**
* Add a recurrences filter (set maximum number of recurrences).
*
* @param int|null $recurrences
*
* @throws \InvalidArgumentException
*
* @return $this
*/
public function setRecurrences($recurrences)
{
if (!is_numeric($recurrences) && !is_null($recurrences) || $recurrences < 0) {
throw new InvalidArgumentException('Invalid number of recurrences.');
}
if ($recurrences === null) {
return $this->removeFilter(static::RECURRENCES_FILTER);
}
$this->recurrences = (int) $recurrences;
if (!$this->hasFilter(static::RECURRENCES_FILTER)) {
return $this->addFilter(static::RECURRENCES_FILTER);
}
$this->handleChangedParameters();
return $this;
}
/**
* Recurrences filter callback (limits number of recurrences).
*
* @param \Carbon\Carbon $current
* @param int $key
*
* @return bool|string
*/
protected function filterRecurrences($current, $key)
{
if ($key < $this->recurrences) {
return true;
}
return static::END_ITERATION;
}
/**
* Change the period start date.
*
* @param DateTime|DateTimeInterface|string $date
* @param bool|null $inclusive
*
* @throws \InvalidArgumentException
*
* @return $this
*/
public function setStartDate($date, $inclusive = null)
{
if (!$date = call_user_func([$this->dateClass, 'make'], $date)) {
throw new InvalidArgumentException('Invalid start date.');
}
$this->startDate = $date;
if ($inclusive !== null) {
$this->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive);
}
return $this;
}
/**
* Change the period end date.
*
* @param DateTime|DateTimeInterface|string|null $date
* @param bool|null $inclusive
*
* @throws \InvalidArgumentException
*
* @return $this
*/
public function setEndDate($date, $inclusive = null)
{
if (!is_null($date) && !$date = call_user_func([$this->dateClass, 'make'], $date)) {
throw new InvalidArgumentException('Invalid end date.');
}
if (!$date) {
return $this->removeFilter(static::END_DATE_FILTER);
}
$this->endDate = $date;
if ($inclusive !== null) {
$this->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive);
}
if (!$this->hasFilter(static::END_DATE_FILTER)) {
return $this->addFilter(static::END_DATE_FILTER);
}
$this->handleChangedParameters();
return $this;
}
/**
* End date filter callback.
*
* @param \Carbon\Carbon $current
*
* @return bool|string
*/
protected function filterEndDate($current)
{
if (!$this->isEndExcluded() && $current == $this->endDate) {
return true;
}
if ($this->dateInterval->invert ? $current > $this->endDate : $current < $this->endDate) {
return true;
}
return static::END_ITERATION;
}
/**
* End iteration filter callback.
*
* @return string
*/
protected function endIteration()
{
return static::END_ITERATION;
}
/**
* Handle change of the parameters.
*/
protected function handleChangedParameters()
{
if (($this->getOptions() & static::IMMUTABLE) && $this->dateClass === Carbon::class) {
$this->setDateClass(CarbonImmutable::class);
} elseif (!($this->getOptions() & static::IMMUTABLE) && $this->dateClass === CarbonImmutable::class) {
$this->setDateClass(Carbon::class);
}
$this->validationResult = null;
}
/**
* Validate current date and stop iteration when necessary.
*
* Returns true when current date is valid, false if it is not, or static::END_ITERATION
* when iteration should be stopped.
*
* @return bool|string
*/
protected function validateCurrentDate()
{
if ($this->current === null) {
$this->rewind();
}
// Check after the first rewind to avoid repeating the initial validation.
if ($this->validationResult !== null) {
return $this->validationResult;
}
return $this->validationResult = $this->checkFilters();
}
/**
* Check whether current value and key pass all the filters.
*
* @return bool|string
*/
protected function checkFilters()
{
$current = $this->prepareForReturn($this->current);
foreach ($this->filters as $tuple) {
$result = call_user_func(
$tuple[0],
$current->copy(),
$this->key,
$this
);
if ($result === static::END_ITERATION) {
return static::END_ITERATION;
}
if (!$result) {
return false;
}
}
return true;
}
/**
* Prepare given date to be returned to the external logic.
*
* @param CarbonInterface $date
*
* @return Carbon
*/
protected function prepareForReturn(CarbonInterface $date)
{
$date = call_user_func([$this->dateClass, 'make'], $date);
if ($this->timezone) {
$date = $date->setTimezone($this->timezone);
}
return $date;
}
/**
* Check if the current position is valid.
*
* @return bool
*/
public function valid()
{
return $this->validateCurrentDate() === true;
}
/**
* Return the current key.
*
* @return int|null
*/
public function key()
{
if ($this->valid()) {
return $this->key;
}
}
/**
* Return the current date.
*
* @return Carbon|null
*/
public function current()
{
if ($this->valid()) {
return $this->prepareForReturn($this->current);
}
}
/**
* Move forward to the next date.
*
* @throws \RuntimeException
*
* @return void
*/
public function next()
{
if ($this->current === null) {
$this->rewind();
}
if ($this->validationResult !== static::END_ITERATION) {
$this->key++;
$this->incrementCurrentDateUntilValid();
}
}
/**
* Rewind to the start date.
*
* Iterating over a date in the UTC timezone avoids bug during backward DST change.
*
* @see https://bugs.php.net/bug.php?id=72255
* @see https://bugs.php.net/bug.php?id=74274
* @see https://wiki.php.net/rfc/datetime_and_daylight_saving_time
*
* @throws \RuntimeException
*
* @return void
*/
public function rewind()
{
$this->key = 0;
$this->current = call_user_func([$this->dateClass, 'make'], $this->startDate);
$this->timezone = static::intervalHasTime($this->dateInterval) ? $this->current->getTimezone() : null;
if ($this->timezone) {
$this->current = $this->current->utc();
}
$this->validationResult = null;
if ($this->isStartExcluded() || $this->validateCurrentDate() === false) {
$this->incrementCurrentDateUntilValid();
}
}
/**
* Skip iterations and returns iteration state (false if ended, true if still valid).
*
* @param int $count steps number to skip (1 by default)
*
* @return bool
*/
public function skip($count = 1)
{
for ($i = $count; $this->valid() && $i > 0; $i--) {
$this->next();
}
return $this->valid();
}
/**
* Keep incrementing the current date until a valid date is found or the iteration is ended.
*
* @throws \RuntimeException
*
* @return void
*/
protected function incrementCurrentDateUntilValid()
{
$attempts = 0;
do {
$this->current = $this->current->add($this->dateInterval);
$this->validationResult = null;
if (++$attempts > static::NEXT_MAX_ATTEMPTS) {
throw new RuntimeException('Could not find next valid date.');
}
} while ($this->validateCurrentDate() === false);
}
/**
* Format the date period as ISO 8601.
*
* @return string
*/
public function toIso8601String()
{
$parts = [];
if ($this->recurrences !== null) {
$parts[] = 'R'.$this->recurrences;
}
$parts[] = $this->startDate->toIso8601String();
$parts[] = $this->dateInterval->spec();
if ($this->endDate !== null) {
$parts[] = $this->endDate->toIso8601String();
}
return implode('/', $parts);
}
/**
* Convert the date period into a string.
*
* @return string
*/
public function toString()
{
$translator = call_user_func([$this->dateClass, 'getTranslator']);
$parts = [];
$format = !$this->startDate->isStartOfDay() || $this->endDate && !$this->endDate->isStartOfDay()
? 'Y-m-d H:i:s'
: 'Y-m-d';
if ($this->recurrences !== null) {
$parts[] = $translator->transChoice('period_recurrences', $this->recurrences, [':count' => $this->recurrences]);
}
$parts[] = $translator->trans('period_interval', [':interval' => $this->dateInterval->forHumans()]);
$parts[] = $translator->trans('period_start_date', [':date' => $this->startDate->format($format)]);
if ($this->endDate !== null) {
$parts[] = $translator->trans('period_end_date', [':date' => $this->endDate->format($format)]);
}
$result = implode(' ', $parts);
return mb_strtoupper(mb_substr($result, 0, 1)).mb_substr($result, 1);
}
/**
* Format the date period as ISO 8601.
*
* @return string
*/
public function spec()
{
return $this->toIso8601String();
}
/**
* Convert the date period into an array without changing current iteration state.
*
* @return array
*/
public function toArray()
{
$state = [
$this->key,
$this->current ? $this->current->copy() : null,
$this->validationResult,
];
$result = iterator_to_array($this);
list(
$this->key,
$this->current,
$this->validationResult
) = $state;
return $result;
}
/**
* Count dates in the date period.
*
* @return int
*/
public function count()
{
return count($this->toArray());
}
/**
* Return the first date in the date period.
*
* @return Carbon|null
*/
public function first()
{
if ($array = $this->toArray()) {
return $array[0];
}
}
/**
* Return the last date in the date period.
*
* @return Carbon|null
*/
public function last()
{
if ($array = $this->toArray()) {
return $array[count($array) - 1];
}
}
/**
* Call given macro.
*
* @param string $name
* @param array $parameters
*
* @return mixed
*/
protected function callMacro($name, $parameters)
{
$macro = static::$macros[$name];
if ($macro instanceof Closure) {
return call_user_func_array($macro->bindTo($this, static::class), $parameters);
}
return call_user_func_array($macro, $parameters);
}
/**
* Convert the date period into a string.
*
* @return string
*/
public function __toString()
{
return $this->toString();
}
/**
* Add aliases for setters.
*
* CarbonPeriod::days(3)->hours(5)->invert()
* ->sinceNow()->until('2010-01-10')
* ->filter(...)
* ->count()
*
* Note: We use magic method to let static and instance aliases with the same names.
*
* @param string $method
* @param array $parameters
*
* @return mixed
*/
public function __call($method, $parameters)
{
if (static::hasMacro($method)) {
return $this->callMacro($method, $parameters);
}
$first = count($parameters) >= 1 ? $parameters[0] : null;
$second = count($parameters) >= 2 ? $parameters[1] : null;
switch ($method) {
case 'start':
case 'since':
return $this->setStartDate($first, $second);
case 'sinceNow':
return $this->setStartDate(new Carbon, $first);
case 'end':
case 'until':
return $this->setEndDate($first, $second);
case 'untilNow':
return $this->setEndDate(new Carbon, $first);
case 'dates':
case 'between':
return $this->setDates($first, $second);
case 'recurrences':
case 'times':
return $this->setRecurrences($first);
case 'options':
return $this->setOptions($first);
case 'toggle':
return $this->toggleOptions($first, $second);
case 'filter':
case 'push':
return $this->addFilter($first, $second);
case 'prepend':
return $this->prependFilter($first, $second);
case 'filters':
return $this->setFilters($first ?: []);
case 'interval':
case 'each':
case 'every':
case 'step':
case 'stepBy':
return $this->setDateInterval($first);
case 'invert':
return $this->invertDateInterval();
case 'years':
case 'year':
case 'months':
case 'month':
case 'weeks':
case 'week':
case 'days':
case 'dayz':
case 'day':
case 'hours':
case 'hour':
case 'minutes':
case 'minute':
case 'seconds':
case 'second':
return $this->setDateInterval(call_user_func(
// Override default P1D when instantiating via fluent setters.
[$this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method],
count($parameters) === 0 ? 1 : $first
));
}
if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) {
throw new BadMethodCallException("Method $method does not exist.");
}
return $this;
}
}
src/Carbon/CarbonTimeZone.php 0000644 00000005140 15014555553 0012137 0 ustar 00 getName());
}
/**
* Returns abbreviated name of the current timezone according to DST setting.
*
* @param bool $dst
*
* @return string
*/
public function getAbbreviatedName($dst = false)
{
$name = $this->getName();
foreach ($this->listAbbreviations() as $abbreviation => $zones) {
foreach ($zones as $zone) {
if ($zone['timezone_id'] === $name && $zone['dst'] == $dst) {
return $abbreviation;
}
}
}
return 'unknown';
}
/**
* @alias getAbbreviatedName
*
* Returns abbreviated name of the current timezone according to DST setting.
*/
public function getAbbr($dst = false)
{
return $this->getAbbreviatedName($dst);
}
/**
* Create a CarbonTimeZone from mixed input.
*
* @param DateTimeZone|string|int|null $object
*
* @return false|static
*/
public static function create($object = null)
{
return static::instance($object);
}
}
src/Carbon/Exceptions/InvalidDateException.php 0000644 00000002413 15014555553 0015444 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException;
class InvalidDateException extends InvalidArgumentException
{
/**
* The invalid field.
*
* @var string
*/
private $field;
/**
* The invalid value.
*
* @var mixed
*/
private $value;
/**
* Constructor.
*
* @param string $field
* @param mixed $value
* @param int $code
* @param \Exception|null $previous
*/
public function __construct($field, $value, $code = 0, Exception $previous = null)
{
$this->field = $field;
$this->value = $value;
parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous);
}
/**
* Get the invalid field.
*
* @return string
*/
public function getField()
{
return $this->field;
}
/**
* Get the invalid value.
*
* @return mixed
*/
public function getValue()
{
return $this->value;
}
}
src/Carbon/Factory.php 0000644 00000121137 15014555553 0010674 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon;
/**
* A factory to generate Carbon instances with common settings.
*
*
*
* @method Carbon create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time.
* If any of $year, $month or $day are set to null their now() values will
* be used.
* If $hour is null it will be set to its now() value and the default
* values for $minute and $second will be their now() values.
* If $hour is not null then the default values for $minute and $second
* will be 0.
* @method Carbon createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now.
* @method Carbon|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format.
* @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today.
* @method Carbon createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today.
* @method Carbon createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp.
* @method Carbon createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds.
* @method Carbon createFromTimestampUTC($timestamp) Create a Carbon instance from an UTC timestamp.
* @method Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight.
* @method Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time.
* If any of $year, $month or $day are set to null their now() values will
* be used.
* If $hour is null it will be set to its now() value and the default
* values for $minute and $second will be their now() values.
* If $hour is not null then the default values for $minute and $second
* will be 0.
* If one of the set values is not valid, an \InvalidArgumentException
* will be thrown.
* @method Carbon disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @method Carbon enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one,
* then return the result of the closure (or null if the closure was void).
* @method Carbon fromSerialized($value) Create an instance from a serialized string.
* @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales.
* (It will ignore custom translator dynamic loading.)
* @method array getDays() Get the days of the week
* @method int getHumanDiffOptions() @return int
* @method array getIsoUnits() Returns list of locale units for ISO formatting.
* @method Carbon getLastErrors() {@inheritdoc}
* @method string getLocale() Get the current translator locale.
* @method int getMidDayAt() get midday/noon hour
* @method Carbon getTestNow() Get the Carbon instance (real or mock) to be returned when a "now"
* instance is created.
* @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use.
* @method int getWeekEndsAt() Get the last day of week
* @method int getWeekStartsAt() Get the first day of week
* @method array getWeekendDays() Get weekend days
* @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format.
* @method bool hasMacro($name) Checks if macro is registered.
* @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date.
* @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance
* is anything that is not null.
* @method Carbon instance($date) Create a Carbon instance from a DateTime one.
* @method bool isImmutable() Returns true if the current class/instance is immutable.
* @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter.
* @method Carbon isMutable()
* @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else.
* (It can be overridden in specific instances.)
* @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).
* Support is considered enabled if the 3 words are translated in the given locale.
* @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).
* Support is considered enabled if the 4 sentences are translated in the given locale.
* @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).
* Support is considered enabled if the 2 words are translated in the given locale.
* @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X).
* Support is considered enabled if the 4 sentences are translated in the given locale.
* @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support.
* Support is considered enabled if either year, day or hour has a short variant translated.
* @method void macro($name, $macro) Register a custom macro.
* @method Carbon|null make($var) Make a Carbon instance from given variable if possible.
* Always return a new instance. Parse only strings and only these likely to be dates (skip intervals
* and recurrences). Throw an exception for invalid format, but otherwise return null.
* @method Carbon maxValue() Create a Carbon instance for the greatest supported date.
* @method Carbon minValue() Create a Carbon instance for the lowest supported date.
* @method void mixin($mixin) Mix another object into the class.
* @method Carbon now($tz = null) Get a Carbon instance for the current date and time.
* @method Carbon parse($time = null, $tz = null) Create a carbon instance from a string.
* This is an alias for the constructor that allows better fluent syntax
* as it allows you to do Carbon::parse('Monday next week')->fn() rather
* than (new Carbon('Monday next week'))->fn().
* @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English).
* @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string
* @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather transform Carbon object before the serialization.
* JSON serialize all Carbon instances using the given callback.
* @method Carbon setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists.
* Pass 'auto' as locale to use closest language from the current LC_TIME locale.
* @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather consider mid-day is always 12pm, then if you need to test if it's an other
* hour, test it explicitly:
* $date->format('G') == 13
* or to set explicitly to a given hour:
* $date->setTime(13, 0, 0, 0)
* Set midday/noon hour
* @method Carbon setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now"
* instance is created. The provided instance will be returned
* specifically under the following conditions:
* - A call to the static now() method, ex. Carbon::now()
* - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null)
* - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now')
* - When a string containing the desired time is passed to Carbon::parse().
* Note the timezone parameter was left out of the examples above and
* has no affect as the mock value will be returned regardless of its value.
* To clear the test instance call this method using the default
* parameter of null.
* /!\ Use this method for unit tests only.
* @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
* use other method or custom format passed to format() method if you need to dump an other string
* format.
* Set the default format used when type juggling a Carbon instance to a string
* @method void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) Set the default translator instance to use.
* @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use UTF-8 language packages on every machine.
* Set if UTF8 will be used for localized date/time.
* @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek
* or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the
* start of week according to current locale selected and implicitly the end of week.
* Set the last day of week
* @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the
* 'first_day_of_week' locale setting to change the start of week according to current locale
* selected and implicitly the end of week.
* Set the first day of week
* @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather consider week-end is always saturday and sunday, and if you have some custom
* week-end days to handle, give to those days an other name and create a macro for them:
* ```
* Carbon::macro('isDayOff', function ($date) {
* return $date->isSunday() || $date->isMonday();
* });
* Carbon::macro('isNotDayOff', function ($date) {
* return !$date->isDayOff();
* });
* if ($someDate->isDayOff()) ...
* if ($someDate->isNotDayOff()) ...
* // Add 5 not-off days
* $count = 5;
* while ($someDate->isDayOff() || ($count-- > 0)) {
* $someDate->addDay();
* }
* ```
* Set weekend days
* @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances).
* @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances).
* @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English).
* @method Carbon today($tz = null) Create a Carbon instance for today.
* @method Carbon tomorrow($tz = null) Create a Carbon instance for tomorrow.
* @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @method Carbon useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @method Carbon yesterday($tz = null) Create a Carbon instance for yesterday.
*
*
*/
class Factory
{
protected $className = Carbon::class;
protected $settings = [];
public function __construct(array $settings = [], string $className = null)
{
if ($className) {
$this->className = $className;
}
$this->settings = $settings;
}
public function getClassName()
{
return $this->className;
}
public function setClassName(string $className)
{
$this->className = $className;
return $this;
}
public function className(string $className = null)
{
return $className === null ? $this->getClassName() : $this->setClassName($className);
}
public function getSettings()
{
return $this->settings;
}
public function setSettings(array $settings)
{
$this->settings = $settings;
return $this;
}
public function settings(array $settings = null)
{
return $settings === null ? $this->getSettings() : $this->setSettings($settings);
}
public function mergeSettings(array $settings)
{
$this->settings = array_merge($this->settings, $settings);
return $this;
}
public function __call($name, $arguments)
{
$result = $this->className::$name(...$arguments);
return $result instanceof CarbonInterface ? $result->settings($this->settings) : $result;
}
}
src/Carbon/FactoryImmutable.php 0000644 00000116520 15014555553 0012534 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon;
/**
* A factory to generate CarbonImmutable instances with common settings.
*
*
*
* @method CarbonImmutable create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time.
* If any of $year, $month or $day are set to null their now() values will
* be used.
* If $hour is null it will be set to its now() value and the default
* values for $minute and $second will be their now() values.
* If $hour is not null then the default values for $minute and $second
* will be 0.
* @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now.
* @method CarbonImmutable|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format.
* @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today.
* @method CarbonImmutable createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today.
* @method CarbonImmutable createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp.
* @method CarbonImmutable createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds.
* @method CarbonImmutable createFromTimestampUTC($timestamp) Create a Carbon instance from an UTC timestamp.
* @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight.
* @method CarbonImmutable|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time.
* If any of $year, $month or $day are set to null their now() values will
* be used.
* If $hour is null it will be set to its now() value and the default
* values for $minute and $second will be their now() values.
* If $hour is not null then the default values for $minute and $second
* will be 0.
* If one of the set values is not valid, an \InvalidArgumentException
* will be thrown.
* @method CarbonImmutable disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @method CarbonImmutable enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one,
* then return the result of the closure (or null if the closure was void).
* @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string.
* @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales.
* (It will ignore custom translator dynamic loading.)
* @method array getDays() Get the days of the week
* @method int getHumanDiffOptions() @return int
* @method array getIsoUnits() Returns list of locale units for ISO formatting.
* @method CarbonImmutable getLastErrors() {@inheritdoc}
* @method string getLocale() Get the current translator locale.
* @method int getMidDayAt() get midday/noon hour
* @method CarbonImmutable getTestNow() Get the Carbon instance (real or mock) to be returned when a "now"
* instance is created.
* @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use.
* @method int getWeekEndsAt() Get the last day of week
* @method int getWeekStartsAt() Get the first day of week
* @method array getWeekendDays() Get weekend days
* @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format.
* @method bool hasMacro($name) Checks if macro is registered.
* @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date.
* @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance
* is anything that is not null.
* @method CarbonImmutable instance($date) Create a Carbon instance from a DateTime one.
* @method bool isImmutable() Returns true if the current class/instance is immutable.
* @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter.
* @method CarbonImmutable isMutable()
* @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else.
* (It can be overridden in specific instances.)
* @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).
* Support is considered enabled if the 3 words are translated in the given locale.
* @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).
* Support is considered enabled if the 4 sentences are translated in the given locale.
* @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).
* Support is considered enabled if the 2 words are translated in the given locale.
* @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X).
* Support is considered enabled if the 4 sentences are translated in the given locale.
* @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support.
* Support is considered enabled if either year, day or hour has a short variant translated.
* @method void macro($name, $macro) Register a custom macro.
* @method CarbonImmutable|null make($var) Make a Carbon instance from given variable if possible.
* Always return a new instance. Parse only strings and only these likely to be dates (skip intervals
* and recurrences). Throw an exception for invalid format, but otherwise return null.
* @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date.
* @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date.
* @method void mixin($mixin) Mix another object into the class.
* @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time.
* @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string.
* This is an alias for the constructor that allows better fluent syntax
* as it allows you to do Carbon::parse('Monday next week')->fn() rather
* than (new Carbon('Monday next week'))->fn().
* @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English).
* @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string
* @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather transform Carbon object before the serialization.
* JSON serialize all Carbon instances using the given callback.
* @method CarbonImmutable setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists.
* Pass 'auto' as locale to use closest language from the current LC_TIME locale.
* @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather consider mid-day is always 12pm, then if you need to test if it's an other
* hour, test it explicitly:
* $date->format('G') == 13
* or to set explicitly to a given hour:
* $date->setTime(13, 0, 0, 0)
* Set midday/noon hour
* @method CarbonImmutable setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now"
* instance is created. The provided instance will be returned
* specifically under the following conditions:
* - A call to the static now() method, ex. Carbon::now()
* - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null)
* - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now')
* - When a string containing the desired time is passed to Carbon::parse().
* Note the timezone parameter was left out of the examples above and
* has no affect as the mock value will be returned regardless of its value.
* To clear the test instance call this method using the default
* parameter of null.
* /!\ Use this method for unit tests only.
* @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
* use other method or custom format passed to format() method if you need to dump an other string
* format.
* Set the default format used when type juggling a Carbon instance to a string
* @method void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) Set the default translator instance to use.
* @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use UTF-8 language packages on every machine.
* Set if UTF8 will be used for localized date/time.
* @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek
* or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the
* start of week according to current locale selected and implicitly the end of week.
* Set the last day of week
* @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the
* 'first_day_of_week' locale setting to change the start of week according to current locale
* selected and implicitly the end of week.
* Set the first day of week
* @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather consider week-end is always saturday and sunday, and if you have some custom
* week-end days to handle, give to those days an other name and create a macro for them:
* ```
* Carbon::macro('isDayOff', function ($date) {
* return $date->isSunday() || $date->isMonday();
* });
* Carbon::macro('isNotDayOff', function ($date) {
* return !$date->isDayOff();
* });
* if ($someDate->isDayOff()) ...
* if ($someDate->isNotDayOff()) ...
* // Add 5 not-off days
* $count = 5;
* while ($someDate->isDayOff() || ($count-- > 0)) {
* $someDate->addDay();
* }
* ```
* Set weekend days
* @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances).
* @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances).
* @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English).
* @method CarbonImmutable today($tz = null) Create a Carbon instance for today.
* @method CarbonImmutable tomorrow($tz = null) Create a Carbon instance for tomorrow.
* @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @method CarbonImmutable useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @method CarbonImmutable yesterday($tz = null) Create a Carbon instance for yesterday.
*
*
*/
class FactoryImmutable extends Factory
{
protected $className = CarbonImmutable::class;
}
src/Carbon/Lang/af.php 0000644 00000004453 15014555553 0010535 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '\'n jaar|:count jare',
'y' => ':count jaar|:count jare',
'month' => '\'n maand|:count maande',
'm' => ':count maand|:count maande',
'week' => ':count week|:count weke',
'w' => ':count week|:count weke',
'day' => '\'n dag|:count dae',
'd' => ':count dag|:count dae',
'hour' => '\'n uur|:count ure',
'h' => ':count uur|:count ure',
'minute' => '\'n minuut|:count minute',
'min' => ':count minuut|:count minute',
'second' => '\'n paar sekondes|:count sekondes',
's' => ':count sekond|:count sekondes',
'ago' => ':time gelede',
'from_now' => 'oor :time',
'after' => ':time na',
'before' => ':time voor',
'diff_yesterday' => 'Gister',
'diff_tomorrow' => 'Môre',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Vandag om] LT',
'nextDay' => '[Môre om] LT',
'nextWeek' => 'dddd [om] LT',
'lastDay' => '[Gister om] LT',
'lastWeek' => '[Laas] dddd [om] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de');
},
'meridiem' => function ($hour, $minute, $isLower) {
$meridiem = $hour < 12 ? 'VM' : 'NM';
return $isLower ? strtolower($meridiem) : $meridiem;
},
'months' => ['Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember'],
'months_short' => ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'],
'weekdays_short' => ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
'weekdays_min' => ['So', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Sa'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/ar.php 0000644 00000004745 15014555553 0010555 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$months = [
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر',
];
return [
'year' => implode('|', ['سنة', 'سنة', 'سنتين', 'سنوات'.' :count', 'سنة'.' :count']),
'month' => implode('|', ['شهر', 'شهر', 'شهرين', 'أشهر'.' :count', 'شهر'.' :count']),
'week' => implode('|', ['أسبوع', 'أسبوع', 'أسبوعين', 'أسابيع'.' :count', 'أسبوع'.' :count']),
'day' => implode('|', ['يوم', 'يوم', 'يومين', 'أيام'.' :count', 'يوم'.' :count']),
'hour' => implode('|', ['ساعة', 'ساعة', 'ساعتين', 'ساعات'.' :count', 'ساعة'.' :count']),
'minute' => implode('|', ['دقيقة', 'دقيقة', 'دقيقتين', 'دقائق'.' :count', 'دقيقة'.' :count']),
'second' => implode('|', ['ثانية', 'ثانية', 'ثانيتين', 'ثوان'.' :count', 'ثانية'.' :count']),
'ago' => 'منذ :time',
'from_now' => ':time من الآن',
'after' => 'بعد :time',
'before' => 'قبل :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'D/M/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[اليوم عند الساعة] LT',
'nextDay' => '[غدًا عند الساعة] LT',
'nextWeek' => 'dddd [عند الساعة] LT',
'lastDay' => '[أمس عند الساعة] LT',
'lastWeek' => 'dddd [عند الساعة] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ص' : 'م';
},
'weekdays' => ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
'weekdays_short' => ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'months' => $months,
'months_short' => $months,
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ar_DZ.php 0000644 00000005074 15014555553 0011146 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => implode('|', ['سنة', 'سنة', 'سنتين', 'سنوات'.' :count', 'سنة'.' :count']),
'month' => implode('|', ['شهر', 'شهر', 'شهرين', 'أشهر'.' :count', 'شهر'.' :count']),
'week' => implode('|', ['أسبوع', 'أسبوع', 'أسبوعين', 'أسابيع'.' :count', 'أسبوع'.' :count']),
'day' => implode('|', ['يوم', 'يوم', 'يومين', 'أيام'.' :count', 'يوم'.' :count']),
'hour' => implode('|', ['ساعة', 'ساعة', 'ساعتين', 'ساعات'.' :count', 'ساعة'.' :count']),
'minute' => implode('|', ['دقيقة', 'دقيقة', 'دقيقتين', 'دقائق'.' :count', 'دقيقة'.' :count']),
'second' => implode('|', ['ثانية', 'ثانية', 'ثانيتين', 'ثوان'.' :count', 'ثانية'.' :count']),
'ago' => 'منذ :time',
'from_now' => 'في :time',
'after' => 'بعد :time',
'before' => 'قبل :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[اليوم على الساعة] LT',
'nextDay' => '[غدا على الساعة] LT',
'nextWeek' => 'dddd [على الساعة] LT',
'lastDay' => '[أمس على الساعة] LT',
'lastWeek' => 'dddd [على الساعة] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ص' : 'م';
},
'months' => ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', 'جويلية', 'أوت', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
'months_short' => ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', 'جويلية', 'أوت', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
'weekdays' => ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
'weekdays_short' => ['احد', 'اثنين', 'ثلاثاء', 'اربعاء', 'خميس', 'جمعة', 'سبت'],
'weekdays_min' => ['أح', 'إث', 'ثلا', 'أر', 'خم', 'جم', 'سب'],
'first_day_of_week' => 0,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/ar_KW.php 0000644 00000005050 15014555553 0011144 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => implode('|', ['سنة', 'سنة', 'سنتين', 'سنوات'.' :count', 'سنة'.' :count']),
'month' => implode('|', ['شهر', 'شهر', 'شهرين', 'أشهر'.' :count', 'شهر'.' :count']),
'week' => implode('|', ['أسبوع', 'أسبوع', 'أسبوعين', 'أسابيع'.' :count', 'أسبوع'.' :count']),
'day' => implode('|', ['يوم', 'يوم', 'يومين', 'أيام'.' :count', 'يوم'.' :count']),
'hour' => implode('|', ['ساعة', 'ساعة', 'ساعتين', 'ساعات'.' :count', 'ساعة'.' :count']),
'minute' => implode('|', ['دقيقة', 'دقيقة', 'دقيقتين', 'دقائق'.' :count', 'دقيقة'.' :count']),
'second' => implode('|', ['ثانية', 'ثانية', 'ثانيتين', 'ثوان'.' :count', 'ثانية'.' :count']),
'ago' => 'منذ :time',
'from_now' => 'في :time',
'after' => 'بعد :time',
'before' => 'قبل :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[اليوم على الساعة] LT',
'nextDay' => '[غدا على الساعة] LT',
'nextWeek' => 'dddd [على الساعة] LT',
'lastDay' => '[أمس على الساعة] LT',
'lastWeek' => 'dddd [على الساعة] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ص' : 'م';
},
'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'ماي', 'يونيو', 'يوليوز', 'غشت', 'شتنبر', 'أكتوبر', 'نونبر', 'دجنبر'],
'months_short' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'ماي', 'يونيو', 'يوليوز', 'غشت', 'شتنبر', 'أكتوبر', 'نونبر', 'دجنبر'],
'weekdays' => ['الأحد', 'الإتنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
'weekdays_short' => ['احد', 'اتنين', 'ثلاثاء', 'اربعاء', 'خميس', 'جمعة', 'سبت'],
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 0,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ar_LY.php 0000644 00000004745 15014555553 0011161 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$months = [
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر',
];
return [
'year' => implode('|', ['سنة', 'سنة', 'سنتين', 'سنوات'.' :count', 'سنة'.' :count']),
'month' => implode('|', ['شهر', 'شهر', 'شهرين', 'أشهر'.' :count', 'شهر'.' :count']),
'week' => implode('|', ['أسبوع', 'أسبوع', 'أسبوعين', 'أسابيع'.' :count', 'أسبوع'.' :count']),
'day' => implode('|', ['يوم', 'يوم', 'يومين', 'أيام'.' :count', 'يوم'.' :count']),
'hour' => implode('|', ['ساعة', 'ساعة', 'ساعتين', 'ساعات'.' :count', 'ساعة'.' :count']),
'minute' => implode('|', ['دقيقة', 'دقيقة', 'دقيقتين', 'دقائق'.' :count', 'دقيقة'.' :count']),
'second' => implode('|', ['ثانية', 'ثانية', 'ثانيتين', 'ثوان'.' :count', 'ثانية'.' :count']),
'ago' => 'منذ :time',
'from_now' => ':time من الآن',
'after' => 'بعد :time',
'before' => 'قبل :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'D/M/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[اليوم عند الساعة] LT',
'nextDay' => '[غدًا عند الساعة] LT',
'nextWeek' => 'dddd [عند الساعة] LT',
'lastDay' => '[أمس عند الساعة] LT',
'lastWeek' => 'dddd [عند الساعة] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ص' : 'م';
},
'weekdays' => ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
'weekdays_short' => ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'months' => $months,
'months_short' => $months,
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ar_MA.php 0000644 00000005050 15014555553 0011120 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => implode('|', ['سنة', 'سنة', 'سنتين', 'سنوات'.' :count', 'سنة'.' :count']),
'month' => implode('|', ['شهر', 'شهر', 'شهرين', 'أشهر'.' :count', 'شهر'.' :count']),
'week' => implode('|', ['أسبوع', 'أسبوع', 'أسبوعين', 'أسابيع'.' :count', 'أسبوع'.' :count']),
'day' => implode('|', ['يوم', 'يوم', 'يومين', 'أيام'.' :count', 'يوم'.' :count']),
'hour' => implode('|', ['ساعة', 'ساعة', 'ساعتين', 'ساعات'.' :count', 'ساعة'.' :count']),
'minute' => implode('|', ['دقيقة', 'دقيقة', 'دقيقتين', 'دقائق'.' :count', 'دقيقة'.' :count']),
'second' => implode('|', ['ثانية', 'ثانية', 'ثانيتين', 'ثوان'.' :count', 'ثانية'.' :count']),
'ago' => 'منذ :time',
'from_now' => 'في :time',
'after' => 'بعد :time',
'before' => 'قبل :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[اليوم على الساعة] LT',
'nextDay' => '[غدا على الساعة] LT',
'nextWeek' => 'dddd [على الساعة] LT',
'lastDay' => '[أمس على الساعة] LT',
'lastWeek' => 'dddd [على الساعة] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ص' : 'م';
},
'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'ماي', 'يونيو', 'يوليوز', 'غشت', 'شتنبر', 'أكتوبر', 'نونبر', 'دجنبر'],
'months_short' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'ماي', 'يونيو', 'يوليوز', 'غشت', 'شتنبر', 'أكتوبر', 'نونبر', 'دجنبر'],
'weekdays' => ['الأحد', 'الإتنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
'weekdays_short' => ['احد', 'اتنين', 'ثلاثاء', 'اربعاء', 'خميس', 'جمعة', 'سبت'],
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ar_SA.php 0000644 00000004770 15014555553 0011136 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => implode('|', ['سنة', 'سنة', 'سنتين', 'سنوات'.' :count', 'سنة'.' :count']),
'month' => implode('|', ['شهر', 'شهر', 'شهرين', 'أشهر'.' :count', 'شهر'.' :count']),
'week' => implode('|', ['أسبوع', 'أسبوع', 'أسبوعين', 'أسابيع'.' :count', 'أسبوع'.' :count']),
'day' => implode('|', ['يوم', 'يوم', 'يومين', 'أيام'.' :count', 'يوم'.' :count']),
'hour' => implode('|', ['ساعة', 'ساعة', 'ساعتين', 'ساعات'.' :count', 'ساعة'.' :count']),
'minute' => implode('|', ['دقيقة', 'دقيقة', 'دقيقتين', 'دقائق'.' :count', 'دقيقة'.' :count']),
'second' => implode('|', ['ثانية', 'ثانية', 'ثانيتين', 'ثوان'.' :count', 'ثانية'.' :count']),
'ago' => 'منذ :time',
'from_now' => 'في :time',
'after' => 'بعد :time',
'before' => 'قبل :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[اليوم على الساعة] LT',
'nextDay' => '[غدا على الساعة] LT',
'nextWeek' => 'dddd [على الساعة] LT',
'lastDay' => '[أمس على الساعة] LT',
'lastWeek' => 'dddd [على الساعة] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ص' : 'م';
},
'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
'months_short' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
'weekdays' => ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
'weekdays_short' => ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
];
src/Carbon/Lang/ar_Shakl.php 0000644 00000005470 15014555553 0011673 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
// Same for long and short
$months = [
// @TODO add shakl to months
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر',
];
return [
'year' => implode('|', ['سَنَة', 'سَنَة', 'سَنَتَيْن', 'سَنَوَات'.' :count', 'سَنَة'.' :count']),
'month' => implode('|', ['شَهْرَ', 'شَهْرَ', 'شَهْرَيْن', 'أَشْهُر'.' :count', 'شَهْرَ'.' :count']),
'week' => implode('|', ['أُسْبُوع', 'أُسْبُوع', 'أُسْبُوعَيْن', 'أَسَابِيع'.' :count', 'أُسْبُوع'.' :count']),
'day' => implode('|', ['يَوْم', 'يَوْم', 'يَوْمَيْن', 'أَيَّام'.' :count', 'يَوْم'.' :count']),
'hour' => implode('|', ['سَاعَة', 'سَاعَة', 'سَاعَتَيْن', 'سَاعَات'.' :count', 'سَاعَة'.' :count']),
'minute' => implode('|', ['دَقِيقَة', 'دَقِيقَة', 'دَقِيقَتَيْن', 'دَقَائِق'.' :count', 'دَقِيقَة'.' :count']),
'second' => implode('|', ['ثَانِيَة', 'ثَانِيَة', 'ثَانِيَتَيْن', 'ثَوَان'.' :count', 'ثَانِيَة'.' :count']),
'ago' => 'مُنْذُ :time',
'from_now' => 'مِنَ الْآن :time',
'after' => 'بَعْدَ :time',
'before' => 'قَبْلَ :time',
// @TODO add shakl to translations below
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'D/M/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[اليوم عند الساعة] LT',
'nextDay' => '[غدًا عند الساعة] LT',
'nextWeek' => 'dddd [عند الساعة] LT',
'lastDay' => '[أمس عند الساعة] LT',
'lastWeek' => 'dddd [عند الساعة] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ص' : 'م';
},
'weekdays' => ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
'weekdays_short' => ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'months' => $months,
'months_short' => $months,
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ar_TN.php 0000644 00000005054 15014555553 0011150 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => implode('|', ['سنة', 'سنة', 'سنتين', 'سنوات'.' :count', 'سنة'.' :count']),
'month' => implode('|', ['شهر', 'شهر', 'شهرين', 'أشهر'.' :count', 'شهر'.' :count']),
'week' => implode('|', ['أسبوع', 'أسبوع', 'أسبوعين', 'أسابيع'.' :count', 'أسبوع'.' :count']),
'day' => implode('|', ['يوم', 'يوم', 'يومين', 'أيام'.' :count', 'يوم'.' :count']),
'hour' => implode('|', ['ساعة', 'ساعة', 'ساعتين', 'ساعات'.' :count', 'ساعة'.' :count']),
'minute' => implode('|', ['دقيقة', 'دقيقة', 'دقيقتين', 'دقائق'.' :count', 'دقيقة'.' :count']),
'second' => implode('|', ['ثانية', 'ثانية', 'ثانيتين', 'ثوان'.' :count', 'ثانية'.' :count']),
'ago' => 'منذ :time',
'from_now' => 'في :time',
'after' => 'بعد :time',
'before' => 'قبل :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[اليوم على الساعة] LT',
'nextDay' => '[غدا على الساعة] LT',
'nextWeek' => 'dddd [على الساعة] LT',
'lastDay' => '[أمس على الساعة] LT',
'lastWeek' => 'dddd [على الساعة] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ص' : 'م';
},
'months' => ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', 'جويلية', 'أوت', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
'months_short' => ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', 'جويلية', 'أوت', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
'weekdays' => ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
'weekdays_short' => ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/az.php 0000644 00000007005 15014555553 0010555 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}bir il|]1,Inf[:count il',
'y' => ':count il',
'month' => '{1}bir ay|]1,Inf[:count ay',
'm' => ':count ay',
'week' => ':count həftə',
'w' => ':count həftə',
'day' => '{1}bir gün|]1,Inf[:count gün',
'd' => ':count gün',
'hour' => '{1}bir saat|]1,Inf[:count saat',
'h' => ':count saat',
'minute' => '{1}bir dəqiqə|]1,Inf[:count dəqiqə',
'min' => ':count dəqiqə',
'second' => '{1}birneçə saniyə|]1,Inf[:count saniyə',
's' => ':count saniyə',
'ago' => ':time əvvəl',
'from_now' => ':time sonra',
'after' => ':time sonra',
'before' => ':time əvvəl',
'diff_now' => 'indi',
'diff_yesterday' => 'dünən',
'diff_tomorrow' => 'sabah',
'diff_before_yesterday' => 'srağagün',
'diff_after_tomorrow' => 'birisi gün',
'period_recurrences' => ':count dəfədən bir',
'period_interval' => 'hər :interval',
'period_start_date' => ':date tarixindən başlayaraq',
'period_end_date' => ':date tarixinədək',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[bugün saat] LT',
'nextDay' => '[sabah saat] LT',
'nextWeek' => '[gələn həftə] dddd [saat] LT',
'lastDay' => '[dünən] LT',
'lastWeek' => '[keçən həftə] dddd [saat] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
if ($number === 0) { // special case for zero
return "$number-ıncı";
}
static $suffixes = [
1 => '-inci',
5 => '-inci',
8 => '-inci',
70 => '-inci',
80 => '-inci',
2 => '-nci',
7 => '-nci',
20 => '-nci',
50 => '-nci',
3 => '-üncü',
4 => '-üncü',
100 => '-üncü',
6 => '-ncı',
9 => '-uncu',
10 => '-uncu',
30 => '-uncu',
60 => '-ıncı',
90 => '-ıncı',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
$lastDigit = $number % 10;
return $number.($suffixes[$lastDigit] ?? $suffixes[$number % 100 - $lastDigit] ?? $suffixes[$number >= 100 ? 100 : -1] ?? '');
},
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'gecə';
}
if ($hour < 12) {
return 'səhər';
}
if ($hour < 17) {
return 'gündüz';
}
return 'axşam';
},
'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'],
'months_short' => ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'],
'weekdays' => ['Bazar', 'Bazar ertəsi', 'Çərşənbə axşamı', 'Çərşənbə', 'Cümə axşamı', 'Cümə', 'Şənbə'],
'weekdays_short' => ['Baz', 'BzE', 'ÇAx', 'Çər', 'CAx', 'Cüm', 'Şən'],
'weekdays_min' => ['Bz', 'BE', 'ÇA', 'Çə', 'CA', 'Cü', 'Şə'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/be.php 0000644 00000010131 15014555553 0010523 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count год|:count гады|:count гадоў',
'y' => ':count год|:count гады|:count гадоў',
'month' => ':count месяц|:count месяцы|:count месяцаў',
'm' => ':count месяц|:count месяцы|:count месяцаў',
'week' => ':count тыдзень|:count тыдні|:count тыдняў',
'w' => ':count тыдзень|:count тыдні|:count тыдняў',
'day' => ':count дзень|:count ні|:count дзён',
'd' => ':count дзень|:count ні|:count дзён',
'hour' => ':count гадзіну|:count гадзіны|:count гадзін',
'h' => ':count гадзіну|:count гадзіны|:count гадзін',
'minute' => ':count хвіліну|:count хвіліны|:count хвілін',
'min' => ':count хвіліну|:count хвіліны|:count хвілін',
'second' => ':count секунду|:count секунды|:count секунд',
's' => ':count секунду|:count секунды|:count секунд',
'ago' => ':time таму',
'from_now' => 'праз :time',
'after' => ':time пасля',
'before' => ':time да',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY г.',
'LLL' => 'D MMMM YYYY г., HH:mm',
'LLLL' => 'dddd, D MMMM YYYY г., HH:mm',
],
'calendar' => [
'sameDay' => '[Сёння ў] LT',
'nextDay' => '[Заўтра ў] LT',
'nextWeek' => '[У] dddd [ў] LT',
'lastDay' => '[Учора ў] LT',
'lastWeek' => function (\Carbon\CarbonInterface $current) {
switch ($current->dayOfWeek) {
case 1:
case 2:
case 4:
return '[У мінулы] dddd [ў] LT';
default:
return '[У мінулую] dddd [ў] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'M':
case 'd':
case 'DDD':
case 'w':
case 'W':
return ($number % 10 === 2 || $number % 10 === 3) && ($number % 100 !== 12 && $number % 100 !== 13) ? $number.'-і' : $number.'-ы';
case 'D':
return $number.'-га';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'ночы';
}
if ($hour < 12) {
return 'раніцы';
}
if ($hour < 17) {
return 'дня';
}
return 'вечара';
},
'months' => ['студзеня', 'лютага', 'сакавіка', 'красавіка', 'траўня', 'чэрвеня', 'ліпеня', 'жніўня', 'верасня', 'кастрычніка', 'лістапада', 'снежня'],
'months_standalone' => ['студзень', 'люты', 'сакавік', 'красавік', 'травень', 'чэрвень', 'ліпень', 'жнівень', 'верасень', 'кастрычнік', 'лістапад', 'снежань'],
'months_short' => ['студ', 'лют', 'сак', 'крас', 'трав', 'чэрв', 'ліп', 'жнів', 'вер', 'каст', 'ліст', 'снеж'],
'weekdays' => ['нядзелю', 'панядзелак', 'аўторак', 'сераду', 'чацвер', 'пятніцу', 'суботу'],
'weekdays_standalone' => ['нядзеля', 'панядзелак', 'аўторак', 'серада', 'чацвер', 'пятніца', 'субота'],
'weekdays_short' => ['нд', 'пн', 'ат', 'ср', 'чц', 'пт', 'сб'],
'weekdays_min' => ['нд', 'пн', 'ат', 'ср', 'чц', 'пт', 'сб'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/bg.php 0000644 00000006356 15014555553 0010543 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'година|:count години',
'y' => ':count година|:count години',
'month' => 'месец|:count месеца',
'm' => ':count месец|:count месеца',
'week' => ':count седмица|:count седмици',
'w' => ':count седмица|:count седмици',
'day' => 'ден|:count дни',
'd' => ':count ден|:count дни',
'hour' => 'час|:count часа',
'h' => ':count час|:count часа',
'minute' => 'минута|:count минути',
'min' => ':count минута|:count минути',
'second' => 'няколко секунди|:count секунди',
's' => ':count секунда|:count секунди',
'ago' => 'преди :time',
'from_now' => 'след :time',
'after' => 'след :time',
'before' => 'преди :time',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'D.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY H:mm',
'LLLL' => 'dddd, D MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[Днес в] LT',
'nextDay' => '[Утре в] LT',
'nextWeek' => 'dddd [в] LT',
'lastDay' => '[Вчера в] LT',
'lastWeek' => function (\Carbon\CarbonInterface $current) {
switch ($current->dayOfWeek) {
case 0:
case 3:
case 6:
return '[В изминалата] dddd [в] LT';
default:
return '[В изминалия] dddd [в] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
$lastDigit = $number % 10;
$last2Digits = $number % 100;
if ($number === 0) {
return "$number-ев";
}
if ($last2Digits === 0) {
return "$number-ен";
}
if ($last2Digits > 10 && $last2Digits < 20) {
return "$number-ти";
}
if ($lastDigit === 1) {
return "$number-ви";
}
if ($lastDigit === 2) {
return "$number-ри";
}
if ($lastDigit === 7 || $lastDigit === 8) {
return "$number-ми";
}
return "$number-ти";
},
'months' => ['януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли', 'август', 'септември', 'октомври', 'ноември', 'декември'],
'months_short' => ['янр', 'фев', 'мар', 'апр', 'май', 'юни', 'юли', 'авг', 'сеп', 'окт', 'ное', 'дек'],
'weekdays' => ['неделя', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота'],
'weekdays_short' => ['нед', 'пон', 'вто', 'сря', 'чет', 'пет', 'съб'],
'weekdays_min' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/bm.php 0000644 00000003532 15014555553 0010542 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'bm');
return [
'year' => 'san kelen|san :count',
'month' => 'kalo kelen|kalo :count',
'week' => 'dɔgɔkun :count',
'day' => 'tile kelen|tile :count',
'hour' => 'lɛrɛ kelen|lɛrɛ :count',
'minute' => 'miniti kelen|miniti :count',
'second' => 'sanga dama dama|sekondi :count',
'ago' => 'a bɛ :time bɔ',
'from_now' => ':time kɔnɔ',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'MMMM [tile] D [san] YYYY',
'LLL' => 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
'LLLL' => 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
],
'calendar' => [
'sameDay' => '[Bi lɛrɛ] LT',
'nextDay' => '[Sini lɛrɛ] LT',
'nextWeek' => 'dddd [don lɛrɛ] LT',
'lastDay' => '[Kunu lɛrɛ] LT',
'lastWeek' => 'dddd [tɛmɛnen lɛrɛ] LT',
'sameElse' => 'L',
],
'months' => ['Zanwuyekalo', 'Fewuruyekalo', 'Marisikalo', 'Awirilikalo', 'Mɛkalo', 'Zuwɛnkalo', 'Zuluyekalo', 'Utikalo', 'Sɛtanburukalo', 'ɔkutɔburukalo', 'Nowanburukalo', 'Desanburukalo'],
'months_short' => ['Zan', 'Few', 'Mar', 'Awi', 'Mɛ', 'Zuw', 'Zul', 'Uti', 'Sɛt', 'ɔku', 'Now', 'Des'],
'weekdays' => ['Kari', 'Ntɛnɛn', 'Tarata', 'Araba', 'Alamisa', 'Juma', 'Sibiri'],
'weekdays_short' => ['Kar', 'Ntɛ', 'Tar', 'Ara', 'Ala', 'Jum', 'Sib'],
'weekdays_min' => ['Ka', 'Nt', 'Ta', 'Ar', 'Al', 'Ju', 'Si'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/bn.php 0000644 00000006540 15014555553 0010545 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'এক বছর|:count বছর',
'y' => '১ বছর|:count বছর',
'month' => 'এক মাস|:count মাস',
'm' => '১ মাস|:count মাস',
'week' => '১ সপ্তাহ|:count সপ্তাহ',
'w' => '১ সপ্তাহ|:count সপ্তাহ',
'day' => 'এক দিন|:count দিন',
'd' => '১ দিন|:count দিন',
'hour' => 'এক ঘন্টা|:count ঘন্টা',
'h' => '১ ঘন্টা|:count ঘন্টা',
'minute' => 'এক মিনিট|:count মিনিট',
'min' => '১ মিনিট|:count মিনিট',
'second' => 'কয়েক সেকেন্ড|:count সেকেন্ড',
's' => '১ সেকেন্ড|:count সেকেন্ড',
'ago' => ':time আগে',
'from_now' => ':time পরে',
'after' => ':time পরে',
'before' => ':time আগে',
'diff_now' => 'এখন',
'diff_yesterday' => 'গতকাল',
'diff_tomorrow' => 'আগামীকাল',
'period_recurrences' => ':count বার|:count বার',
'period_interval' => 'প্রতি :interval',
'period_start_date' => ':date থেকে',
'period_end_date' => ':date পর্যন্ত',
'formats' => [
'LT' => 'A h:mm সময়',
'LTS' => 'A h:mm:ss সময়',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, A h:mm সময়',
'LLLL' => 'dddd, D MMMM YYYY, A h:mm সময়',
],
'calendar' => [
'sameDay' => '[আজ] LT',
'nextDay' => '[আগামীকাল] LT',
'nextWeek' => 'dddd, LT',
'lastDay' => '[গতকাল] LT',
'lastWeek' => '[গত] dddd, LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'রাত';
}
if ($hour < 10) {
return 'সকাল';
}
if ($hour < 17) {
return 'দুপুর';
}
if ($hour < 20) {
return 'বিকাল';
}
return 'রাত';
},
'months' => ['জানুয়ারী', 'ফেব্রুয়ারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'],
'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্র', 'মে', 'জুন', 'জুল', 'আগ', 'সেপ্ট', 'অক্টো', 'নভে', 'ডিসে'],
'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'],
'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'],
'weekdays_min' => ['রবি', 'সোম', 'মঙ্গ', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'],
];
src/Carbon/Lang/bo.php 0000644 00000006614 15014555553 0010550 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}ལོ་གཅིག|]1,Inf[:count ལོ',
'month' => '{1}ཟླ་བ་གཅིག|]1,Inf[:count ཟླ་བ',
'week' => ':count བདུན་ཕྲག',
'day' => '{1}ཉིན་གཅིག|]1,Inf[:count ཉིན་',
'hour' => '{1}ཆུ་ཚོད་གཅིག|]1,Inf[:count ཆུ་ཚོད',
'minute' => '{1}སྐར་མ་གཅིག|]1,Inf[:count སྐར་མ',
'second' => '{1}ལམ་སང|]1,Inf[:count སྐར་ཆ།',
'ago' => ':time སྔན་ལ',
'from_now' => ':time ལ་',
'diff_yesterday' => 'ཁ་སང',
'diff_tomorrow' => 'སང་ཉིན',
'formats' => [
'LT' => 'A h:mm',
'LTS' => 'A h:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, A h:mm',
'LLLL' => 'dddd, D MMMM YYYY, A h:mm',
],
'calendar' => [
'sameDay' => '[དི་རིང] LT',
'nextDay' => '[སང་ཉིན] LT',
'nextWeek' => '[བདུན་ཕྲག་རྗེས་མ], LT',
'lastDay' => '[ཁ་སང] LT',
'lastWeek' => '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'མཚན་མོ';
}
if ($hour < 10) {
return 'ཞོགས་ཀས';
}
if ($hour < 17) {
return 'ཉིན་གུང';
}
if ($hour < 20) {
return 'དགོང་དག';
}
return 'མཚན་མོ';
},
'months' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'],
'months_short' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'],
'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'],
'weekdays_short' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ', 'པ་སངས་', 'སྤེན་པ་'],
'weekdays_min' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ', 'པ་སངས་', 'སྤེན་པ་'],
];
src/Carbon/Lang/br.php 0000644 00000003634 15014555553 0010552 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'br');
return [
'year' => 'ur bloaz|{1,3,4,5,9}:count bloaz|:count vloaz',
'month' => 'ur miz|{2}:count viz|:count miz',
'week' => ':count sizhun',
'day' => 'un devezh|{2}:count zevezh|:count devezh',
'hour' => 'un eur|:count eur',
'minute' => 'ur vunutenn|{2}:count vunutenn|:count munutenn',
'second' => 'un nebeud segondennoù|:count eilenn',
'ago' => ':time \'zo',
'from_now' => 'a-benn :time',
'formats' => [
'LT' => 'h[e]mm A',
'LTS' => 'h[e]mm:ss A',
'L' => 'DD/MM/YYYY',
'LL' => 'D [a viz] MMMM YYYY',
'LLL' => 'D [a viz] MMMM YYYY h[e]mm A',
'LLLL' => 'dddd, D [a viz] MMMM YYYY h[e]mm A',
],
'calendar' => [
'sameDay' => '[Hiziv da] LT',
'nextDay' => '[Warc\'hoazh da] LT',
'nextWeek' => 'dddd [da] LT',
'lastDay' => '[Dec\'h da] LT',
'lastWeek' => 'dddd [paset da] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
return $number.($number === 1 ? 'añ' : 'vet');
},
'months' => ['Genver', 'C\'hwevrer', 'Meurzh', 'Ebrel', 'Mae', 'Mezheven', 'Gouere', 'Eost', 'Gwengolo', 'Here', 'Du', 'Kerzu'],
'months_short' => ['Gen', 'C\'hwe', 'Meu', 'Ebr', 'Mae', 'Eve', 'Gou', 'Eos', 'Gwe', 'Her', 'Du', 'Ker'],
'weekdays' => ['Sul', 'Lun', 'Meurzh', 'Merc\'her', 'Yaou', 'Gwener', 'Sadorn'],
'weekdays_short' => ['Sul', 'Lun', 'Meu', 'Mer', 'Yao', 'Gwe', 'Sad'],
'weekdays_min' => ['Su', 'Lu', 'Me', 'Mer', 'Ya', 'Gw', 'Sa'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/bs.php 0000644 00000005750 15014555553 0010554 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count godina|:count godine|:count godina',
'y' => ':count godina|:count godine|:count godina',
'month' => ':count mjesec|:count mjeseca|:count mjeseci',
'm' => ':count mjesec|:count mjeseca|:count mjeseci',
'week' => ':count nedjelja|:count nedjelje|:count nedjelja',
'w' => ':count nedjelja|:count nedjelje|:count nedjelja',
'day' => ':count dan|:count dana|:count dana',
'd' => ':count dan|:count dana|:count dana',
'hour' => ':count sat|:count sata|:count sati',
'h' => ':count sat|:count sata|:count sati',
'minute' => ':count minut|:count minuta|:count minuta',
'min' => ':count minut|:count minuta|:count minuta',
'second' => ':count sekund|:count sekunda|:count sekundi',
's' => ':count sekund|:count sekunda|:count sekundi',
'ago' => 'prije :time',
'from_now' => 'za :time',
'after' => 'nakon :time',
'before' => ':time ranije',
'diff_yesterday' => 'jučer',
'diff_tomorrow' => 'sutra',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY H:mm',
'LLLL' => 'dddd, D. MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[danas u] LT',
'nextDay' => '[sutra u] LT',
'nextWeek' => function (\Carbon\CarbonInterface $current) {
switch ($current->dayOfWeek) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
default:
return '[u] dddd [u] LT';
}
},
'lastDay' => '[jučer u] LT',
'lastWeek' => function (\Carbon\CarbonInterface $current) {
switch ($current->dayOfWeek) {
case 0:
case 3:
return '[prošlu] dddd [u] LT';
case 6:
return '[prošle] [subote] [u] LT';
default:
return '[prošli] dddd [u] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'juni', 'juli', 'august', 'septembar', 'oktobar', 'novembar', 'decembar'],
'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj.', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'],
'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'],
'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'],
'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/bs_BA.php 0000644 00000005750 15014555553 0011116 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count godina|:count godine|:count godina',
'y' => ':count godina|:count godine|:count godina',
'month' => ':count mjesec|:count mjeseca|:count mjeseci',
'm' => ':count mjesec|:count mjeseca|:count mjeseci',
'week' => ':count nedjelja|:count nedjelje|:count nedjelja',
'w' => ':count nedjelja|:count nedjelje|:count nedjelja',
'day' => ':count dan|:count dana|:count dana',
'd' => ':count dan|:count dana|:count dana',
'hour' => ':count sat|:count sata|:count sati',
'h' => ':count sat|:count sata|:count sati',
'minute' => ':count minut|:count minuta|:count minuta',
'min' => ':count minut|:count minuta|:count minuta',
'second' => ':count sekund|:count sekunda|:count sekundi',
's' => ':count sekund|:count sekunda|:count sekundi',
'ago' => 'prije :time',
'from_now' => 'za :time',
'after' => 'nakon :time',
'before' => ':time ranije',
'diff_yesterday' => 'jučer',
'diff_tomorrow' => 'sutra',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY H:mm',
'LLLL' => 'dddd, D. MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[danas u] LT',
'nextDay' => '[sutra u] LT',
'nextWeek' => function (\Carbon\CarbonInterface $current) {
switch ($current->dayOfWeek) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
default:
return '[u] dddd [u] LT';
}
},
'lastDay' => '[jučer u] LT',
'lastWeek' => function (\Carbon\CarbonInterface $current) {
switch ($current->dayOfWeek) {
case 0:
case 3:
return '[prošlu] dddd [u] LT';
case 6:
return '[prošle] [subote] [u] LT';
default:
return '[prošli] dddd [u] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'juni', 'juli', 'august', 'septembar', 'oktobar', 'novembar', 'decembar'],
'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj.', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'],
'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'],
'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'],
'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ca.php 0000644 00000006751 15014555553 0010535 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un any|:count anys',
'y' => ':count any|:count anys',
'month' => 'un mes|:count mesos',
'm' => ':count mes|:count mesos',
'week' => ':count setmana|:count setmanes',
'w' => ':count setmana|:count setmanes',
'day' => 'un dia|:count dies',
'd' => ':count dia|:count dies',
'hour' => 'una hora|:count hores',
'h' => ':count hora|:count hores',
'minute' => 'un minut|:count minuts',
'min' => ':count minut|:count minuts',
'second' => 'uns segons|:count segons',
's' => ':count segon|:count segons',
'ago' => 'fa :time',
'from_now' => 'd\'aquí :time',
'after' => ':time després',
'before' => ':time abans',
'diff_now' => 'ara mateix',
'diff_yesterday' => 'ahir',
'diff_tomorrow' => 'demà',
'diff_before_yesterday' => 'abans d\'ahir',
'diff_after_tomorrow' => 'demà passat',
'period_recurrences' => ':count cop|:count cops',
'period_interval' => 'cada :interval',
'period_start_date' => 'de :date',
'period_end_date' => 'fins a :date',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM [de] YYYY',
'LLL' => 'D MMMM [de] YYYY [a les] H:mm',
'LLLL' => 'dddd D MMMM [de] YYYY [a les] H:mm',
],
'calendar' => [
'sameDay' => function (\Carbon\CarbonInterface $current) {
return '[avui a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
},
'nextDay' => function (\Carbon\CarbonInterface $current) {
return '[demà a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
},
'nextWeek' => function (\Carbon\CarbonInterface $current) {
return 'dddd [a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
},
'lastDay' => function (\Carbon\CarbonInterface $current) {
return '[ahir a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
},
'lastWeek' => function (\Carbon\CarbonInterface $current) {
return '[el] dddd [passat a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
},
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
return $number.(
($period === 'w' || $period === 'W') ? 'a' : (
($number === 1) ? 'r' : (
($number === 2) ? 'n' : (
($number === 3) ? 'r' : (
($number === 4) ? 't' : 'è'
)
)
)
)
);
},
'months' => ['gener', 'febrer', 'març', 'abril', 'maig', 'juny', 'juliol', 'agost', 'setembre', 'octubre', 'novembre', 'desembre'],
'months_standalone' => ['de gener', 'de febrer', 'de març', 'd\'abril', 'de maig', 'de juny', 'de juliol', 'd\'agost', 'de setembre', 'd\'octubre', 'de novembre', 'de desembre'],
'months_short' => ['gen.', 'febr.', 'març', 'abr.', 'maig', 'juny', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', 'des.'],
'weekdays' => ['diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte'],
'weekdays_short' => ['dg.', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.'],
'weekdays_min' => ['dg', 'dl', 'dt', 'dc', 'dj', 'dv', 'ds'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/cs.php 0000644 00000002321 15014555553 0010544 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count rok|:count roky|:count let',
'y' => ':count rok|:count roky|:count let',
'month' => ':count měsíc|:count měsíce|:count měsíců',
'm' => ':count měsíc|:count měsíce|:count měsíců',
'week' => ':count týden|:count týdny|:count týdnů',
'w' => ':count týden|:count týdny|:count týdnů',
'day' => ':count den|:count dny|:count dní',
'd' => ':count den|:count dny|:count dní',
'hour' => ':count hodinu|:count hodiny|:count hodin',
'h' => ':count hodinu|:count hodiny|:count hodin',
'minute' => ':count minutu|:count minuty|:count minut',
'min' => ':count minutu|:count minuty|:count minut',
'second' => ':count sekundu|:count sekundy|:count sekund',
's' => ':count sekundu|:count sekundy|:count sekund',
'ago' => ':time nazpět',
'from_now' => 'za :time',
'after' => ':time později',
'before' => ':time předtím',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/cv.php 0000644 00000004615 15014555553 0010557 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'cv');
return [
'year' => 'пӗр ҫул|:count ҫул',
'month' => 'пӗр уйӑх|:count уйӑх',
'week' => 'пӗр эрне|:count эрне',
'day' => 'пӗр кун|:count кун',
'hour' => 'пӗр сехет|:count сехет',
'minute' => 'пӗр минут|:count минут',
'second' => 'пӗр-ик ҫеккунт|:count ҫеккунт',
'ago' => ':time каялла',
'from_now' => function ($time) {
return $time.(preg_match('/сехет$/', $time) ? 'рен' : (preg_match('/ҫул/', $time) ? 'тан' : 'ран'));
},
'diff_yesterday' => 'Ӗнер',
'diff_tomorrow' => 'Ыран',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD-MM-YYYY',
'LL' => 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
'LLL' => 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
'LLLL' => 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
],
'calendar' => [
'sameDay' => '[Паян] LT [сехетре]',
'nextDay' => '[Ыран] LT [сехетре]',
'nextWeek' => '[Ҫитес] dddd LT [сехетре]',
'lastDay' => '[Ӗнер] LT [сехетре]',
'lastWeek' => '[Иртнӗ] dddd LT [сехетре]',
'sameElse' => 'L',
],
'ordinal' => ':number-мӗш',
'months' => ['кӑрлач', 'нарӑс', 'пуш', 'ака', 'май', 'ҫӗртме', 'утӑ', 'ҫурла', 'авӑн', 'юпа', 'чӳк', 'раштав'],
'months_short' => ['кӑр', 'нар', 'пуш', 'ака', 'май', 'ҫӗр', 'утӑ', 'ҫур', 'авн', 'юпа', 'чӳк', 'раш'],
'weekdays' => ['вырсарникун', 'тунтикун', 'ытларикун', 'юнкун', 'кӗҫнерникун', 'эрнекун', 'шӑматкун'],
'weekdays_short' => ['выр', 'тун', 'ытл', 'юн', 'кӗҫ', 'эрн', 'шӑм'],
'weekdays_min' => ['вр', 'тн', 'ыт', 'юн', 'кҫ', 'эр', 'шм'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/cy.php 0000644 00000004533 15014555553 0010561 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}blwyddyn|]1,Inf[:count flynedd',
'y' => ':countbl',
'month' => '{1}mis|]1,Inf[:count mis',
'm' => ':countmi',
'week' => ':count wythnos',
'w' => ':countw',
'day' => '{1}diwrnod|]1,Inf[:count diwrnod',
'd' => ':countd',
'hour' => '{1}awr|]1,Inf[:count awr',
'h' => ':counth',
'minute' => '{1}munud|]1,Inf[:count munud',
'min' => ':countm',
'second' => '{1}ychydig eiliadau|]1,Inf[:count eiliad',
's' => ':counts',
'ago' => ':time yn ôl',
'from_now' => 'mewn :time',
'after' => ':time ar ôl',
'before' => ':time o\'r blaen',
'diff_yesterday' => 'Ddoe',
'diff_tomorrow' => 'Yfory',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Heddiw am] LT',
'nextDay' => '[Yfory am] LT',
'nextWeek' => 'dddd [am] LT',
'lastDay' => '[Ddoe am] LT',
'lastWeek' => 'dddd [diwethaf am] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
return $number.($number > 20
? (in_array($number, [40, 50, 60, 80, 100]) ? 'fed' : 'ain')
: ([
'', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed', // 11eg to 20fed
])[$number] ?? ''
);
},
'months' => ['Ionawr', 'Chwefror', 'Mawrth', 'Ebrill', 'Mai', 'Mehefin', 'Gorffennaf', 'Awst', 'Medi', 'Hydref', 'Tachwedd', 'Rhagfyr'],
'months_short' => ['Ion', 'Chwe', 'Maw', 'Ebr', 'Mai', 'Meh', 'Gor', 'Aws', 'Med', 'Hyd', 'Tach', 'Rhag'],
'weekdays' => ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'],
'weekdays_short' => ['Sul', 'Llun', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'],
'weekdays_min' => ['Su', 'Ll', 'Ma', 'Me', 'Ia', 'Gw', 'Sa'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/da.php 0000644 00000003730 15014555553 0010530 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'et år|:count år',
'y' => ':count år|:count år',
'month' => 'en måned|:count måneder',
'm' => ':count måned|:count måneder',
'week' => ':count uge|:count uger',
'w' => ':count uge|:count uger',
'day' => 'en dag|:count dage',
'd' => ':count dag|:count dage',
'hour' => 'en time|:count timer',
'h' => ':count time|:count timer',
'minute' => 'et minut|:count minutter',
'min' => ':count minut|:count minutter',
'second' => 'få sekunder|:count sekunder',
's' => ':count sekund|:count sekunder',
'ago' => ':time siden',
'from_now' => 'om :time',
'after' => ':time efter',
'before' => ':time før',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY HH:mm',
'LLLL' => 'dddd [d.] D. MMMM YYYY [kl.] HH:mm',
],
'calendar' => [
'sameDay' => '[i dag kl.] LT',
'nextDay' => '[i morgen kl.] LT',
'nextWeek' => 'på dddd [kl.] LT',
'lastDay' => '[i går kl.] LT',
'lastWeek' => '[i] dddd[s kl.] LT',
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'],
'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
'weekdays' => ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'],
'weekdays_short' => ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'],
'weekdays_min' => ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/de.php 0000644 00000005063 15014555553 0010535 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count Jahr|:count Jahre',
'y' => ':countJ|:countJ',
'month' => ':count Monat|:count Monate',
'm' => ':countMon|:countMon',
'week' => ':count Woche|:count Wochen',
'w' => ':countWo|:countWo',
'day' => ':count Tag|:count Tage',
'd' => ':countTg|:countTg',
'hour' => ':count Stunde|:count Stunden',
'h' => ':countStd|:countStd',
'minute' => ':count Minute|:count Minuten',
'min' => ':countMin|:countMin',
'second' => ':count Sekunde|:count Sekunden',
's' => ':countSek|:countSek',
'ago' => 'vor :time',
'from_now' => 'in :time',
'after' => ':time später',
'before' => ':time zuvor',
'year_from_now' => ':count Jahr|:count Jahren',
'month_from_now' => ':count Monat|:count Monaten',
'week_from_now' => ':count Woche|:count Wochen',
'day_from_now' => ':count Tag|:count Tagen',
'year_ago' => ':count Jahr|:count Jahren',
'month_ago' => ':count Monat|:count Monaten',
'week_ago' => ':count Woche|:count Wochen',
'day_ago' => ':count Tag|:count Tagen',
'diff_now' => 'Gerade eben',
'diff_yesterday' => 'Gestern',
'diff_tomorrow' => 'Heute',
'diff_before_yesterday' => 'Vorgestern',
'diff_after_tomorrow' => 'Übermorgen',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY HH:mm',
'LLLL' => 'dddd, D. MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[heute um] LT [Uhr]',
'nextDay' => '[morgen um] LT [Uhr]',
'nextWeek' => 'dddd [um] LT [Uhr]',
'lastDay' => '[gestern um] LT [Uhr]',
'lastWeek' => '[letzten] dddd [um] LT [Uhr]',
'sameElse' => 'L',
],
'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
'months_short' => ['Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Dez.'],
'weekdays' => ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
'weekdays_short' => ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'],
'weekdays_min' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
'ordinal' => ':number.',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/de_AT.php 0000644 00000005056 15014555553 0011123 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count Jahr|:count Jahre',
'y' => ':countJ|:countJ',
'month' => ':count Monat|:count Monate',
'm' => ':countMon|:countMon',
'week' => ':count Woche|:count Wochen',
'w' => ':countWo|:countWo',
'day' => ':count Tag|:count Tage',
'd' => ':countTg|:countTg',
'hour' => ':count Stunde|:count Stunden',
'h' => ':countStd|:countStd',
'minute' => ':count Minute|:count Minuten',
'min' => ':countMin|:countMin',
'second' => ':count Sekunde|:count Sekunden',
's' => ':countSek|:countSek',
'ago' => 'vor :time',
'from_now' => 'in :time',
'after' => ':time später',
'before' => ':time zuvor',
'year_from_now' => ':count Jahr|:count Jahren',
'month_from_now' => ':count Monat|:count Monaten',
'week_from_now' => ':count Woche|:count Wochen',
'day_from_now' => ':count Tag|:count Tagen',
'year_ago' => ':count Jahr|:count Jahren',
'month_ago' => ':count Monat|:count Monaten',
'week_ago' => ':count Woche|:count Wochen',
'day_ago' => ':count Tag|:count Tagen',
'diff_now' => 'Gerade eben',
'diff_yesterday' => 'Gestern',
'diff_tomorrow' => 'Heute',
'diff_before_yesterday' => 'Vorgestern',
'diff_after_tomorrow' => 'Übermorgen',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY HH:mm',
'LLLL' => 'dddd, D. MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[heute um] LT [Uhr]',
'nextDay' => '[morgen um] LT [Uhr]',
'nextWeek' => 'dddd [um] LT [Uhr]',
'lastDay' => '[gestern um] LT [Uhr]',
'lastWeek' => '[letzten] dddd [um] LT [Uhr]',
'sameElse' => 'L',
],
'months' => ['Jänuar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
'months_short' => ['Jän.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Dez.'],
'weekdays' => ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
'weekdays_short' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
'weekdays_min' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
'ordinal' => ':number.',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/de_CH.php 0000644 00000005054 15014555553 0011107 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count Jahr|:count Jahre',
'y' => ':countJ|:countJ',
'month' => ':count Monat|:count Monate',
'm' => ':countMon|:countMon',
'week' => ':count Woche|:count Wochen',
'w' => ':countWo|:countWo',
'day' => ':count Tag|:count Tage',
'd' => ':countTg|:countTg',
'hour' => ':count Stunde|:count Stunden',
'h' => ':countStd|:countStd',
'minute' => ':count Minute|:count Minuten',
'min' => ':countMin|:countMin',
'second' => ':count Sekunde|:count Sekunden',
's' => ':countSek|:countSek',
'ago' => 'vor :time',
'from_now' => 'in :time',
'after' => ':time später',
'before' => ':time zuvor',
'year_from_now' => ':count Jahr|:count Jahren',
'month_from_now' => ':count Monat|:count Monaten',
'week_from_now' => ':count Woche|:count Wochen',
'day_from_now' => ':count Tag|:count Tagen',
'year_ago' => ':count Jahr|:count Jahren',
'month_ago' => ':count Monat|:count Monaten',
'week_ago' => ':count Woche|:count Wochen',
'day_ago' => ':count Tag|:count Tagen',
'diff_now' => 'Gerade eben',
'diff_yesterday' => 'Gestern',
'diff_tomorrow' => 'Heute',
'diff_before_yesterday' => 'Vorgestern',
'diff_after_tomorrow' => 'Übermorgen',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY HH:mm',
'LLLL' => 'dddd, D. MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[heute um] LT [Uhr]',
'nextDay' => '[morgen um] LT [Uhr]',
'nextWeek' => 'dddd [um] LT [Uhr]',
'lastDay' => '[gestern um] LT [Uhr]',
'lastWeek' => '[letzten] dddd [um] LT [Uhr]',
'sameElse' => 'L',
],
'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
'months_short' => ['Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Dez.'],
'weekdays' => ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
'weekdays_short' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
'weekdays_min' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
'ordinal' => ':number.',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/dv.php 0000644 00000004326 15014555553 0010557 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'dv');
$months = [
'ޖެނުއަރީ',
'ފެބްރުއަރީ',
'މާރިޗު',
'އޭޕްރީލު',
'މޭ',
'ޖޫން',
'ޖުލައި',
'އޯގަސްޓު',
'ސެޕްޓެމްބަރު',
'އޮކްޓޯބަރު',
'ނޮވެމްބަރު',
'ޑިސެމްބަރު',
];
$weekdays = [
'އާދިއްތަ',
'ހޯމަ',
'އަންގާރަ',
'ބުދަ',
'ބުރާސްފަތި',
'ހުކުރު',
'ހޮނިހިރު',
];
return [
'year' => 'އަހަރެއް|އަހަރު :count',
'month' => 'މަހެއް|މަސް :count',
'week' => 'ހަފްތާ :count',
'day' => 'ދުވަހެއް|ދުވަސް :count',
'hour' => 'ގަޑިއިރެއް|ގަޑިއިރު :count',
'minute' => 'މިނިޓެއް|މިނިޓު :count',
'second' => 'ސިކުންތުކޮޅެއް|d% ސިކުންތު',
'ago' => 'ކުރިން :time',
'from_now' => 'ތެރޭގައި :time',
'after' => ':time ފަހުން',
'before' => ':time ކުރި',
'diff_yesterday' => 'އިއްޔެ',
'diff_tomorrow' => 'މާދަމާ',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'D/M/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[މިއަދު] LT',
'nextDay' => '[މާދަމާ] LT',
'nextWeek' => 'dddd LT',
'lastDay' => '[އިއްޔެ] LT',
'lastWeek' => '[ފާއިތުވި] dddd LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'މކ' : 'މފ';
},
'months' => $months,
'months_short' => $months,
'weekdays' => $weekdays,
'weekdays_short' => $weekdays,
'weekdays_min' => ['އާދި', 'ހޯމަ', 'އަން', 'ބުދަ', 'ބުރާ', 'ހުކު', 'ހޮނި'],
];
src/Carbon/Lang/dv_MV.php 0000644 00000005327 15014555553 0011163 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'dv');
$months = [
'ޖެނުއަރީ',
'ފެބްރުއަރީ',
'މާރިޗު',
'އޭޕްރީލު',
'މޭ',
'ޖޫން',
'ޖުލައި',
'އޯގަސްޓު',
'ސެޕްޓެމްބަރު',
'އޮކްޓޯބަރު',
'ނޮވެމްބަރު',
'ޑިސެމްބަރު',
];
$weekdays = [
'އާދިއްތަ',
'ހޯމަ',
'އަންގާރަ',
'ބުދަ',
'ބުރާސްފަތި',
'ހުކުރު',
'ހޮނިހިރު',
];
return [
'year' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު',
'y' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު',
'month' => '{0}މައްސަރެއް|[1,Inf]:count މަސް',
'm' => '{0}މައްސަރެއް|[1,Inf]:count މަސް',
'week' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ',
'w' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ',
'day' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް',
'd' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް',
'hour' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި',
'h' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި',
'minute' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް',
'min' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް',
'second' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު',
's' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު',
'ago' => ':time ކުރިން',
'from_now' => ':time ފަހުން',
'after' => ':time ފަހުން',
'before' => ':time ކުރި',
'diff_yesterday' => 'އިއްޔެ',
'diff_tomorrow' => 'މާދަމާ',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'D/M/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[މިއަދު] LT',
'nextDay' => '[މާދަމާ] LT',
'nextWeek' => 'dddd LT',
'lastDay' => '[އިއްޔެ] LT',
'lastWeek' => '[ފާއިތުވި] dddd LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'މކ' : 'މފ';
},
'months' => $months,
'months_short' => $months,
'weekdays' => $weekdays,
'weekdays_short' => $weekdays,
'weekdays_min' => ['އާދި', 'ހޯމަ', 'އަން', 'ބުދަ', 'ބުރާ', 'ހުކު', 'ހޮނި'],
];
src/Carbon/Lang/el.php 0000644 00000006277 15014555553 0010555 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'ένας χρόνος|:count χρόνια',
'y' => ':count χρόνος|:count χρόνια',
'month' => 'ένας μήνας|:count μήνες',
'm' => ':count μήνας|:count μήνες',
'week' => ':count εβδομάδα|:count εβδομάδες',
'w' => ':count εβδομάδα|:count εβδομάδες',
'day' => 'μία μέρα|:count μέρες',
'd' => ':count μέρα|:count μέρες',
'hour' => 'μία ώρα|:count ώρες',
'h' => ':count ώρα|:count ώρες',
'minute' => 'ένα λεπτό|:count λεπτά',
'min' => ':count λεπτό|:count λεπτά',
'second' => 'λίγα δευτερόλεπτα|:count δευτερόλεπτα',
's' => ':count δευτερόλεπτο|:count δευτερόλεπτα',
'ago' => ':time πριν',
'from_now' => 'σε :time',
'after' => ':time μετά',
'before' => ':time πριν',
'formats' => [
'LT' => 'h:mm A',
'LTS' => 'h:mm:ss A',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY h:mm A',
'LLLL' => 'dddd, D MMMM YYYY h:mm A',
],
'calendar' => [
'sameDay' => '[Σήμερα {}] LT',
'nextDay' => '[Αύριο {}] LT',
'nextWeek' => 'dddd [{}] LT',
'lastDay' => '[Χθες {}] LT',
'lastWeek' => function (\Carbon\CarbonInterface $current) {
switch ($current->dayOfWeek) {
case 6:
return '[το προηγούμενο] dddd [{}] LT';
default:
return '[την προηγούμενη] dddd [{}] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':numberη',
'meridiem' => function ($hour, $minute, $isLower) {
return $isLower
? ($hour > 11 ? 'μμ' : 'πμ')
: ($hour > 11 ? 'ΜΜ' : 'ΠΜ');
},
'months' => ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'],
'months_standalone' => ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'],
'months_short' => ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'],
'weekdays' => ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'],
'weekdays_short' => ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'],
'weekdays_min' => ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/en.php 0000644 00000004120 15014555553 0010540 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count year|:count years',
'y' => ':countyr|:countyrs',
'month' => ':count month|:count months',
'm' => ':countmo|:countmos',
'week' => ':count week|:count weeks',
'w' => ':countw|:countw',
'day' => ':count day|:count days',
'd' => ':countd|:countd',
'hour' => ':count hour|:count hours',
'h' => ':counth|:counth',
'minute' => ':count minute|:count minutes',
'min' => ':countm|:countm',
'second' => ':count second|:count seconds',
's' => ':counts|:counts',
'ago' => ':time ago',
'from_now' => ':time from now',
'after' => ':time after',
'before' => ':time before',
'diff_now' => 'just now',
'diff_yesterday' => 'yesterday',
'diff_tomorrow' => 'tomorrow',
'diff_before_yesterday' => 'before yesterday',
'diff_after_tomorrow' => 'after tomorrow',
'period_recurrences' => 'once|:count times',
'period_interval' => 'every :interval',
'period_start_date' => 'from :date',
'period_end_date' => 'to :date',
'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'ordinal' => function ($number) {
$lastDigit = $number % 10;
return $number.(
(~~($number % 100 / 10) === 1) ? 'th' : (
($lastDigit === 1) ? 'st' : (
($lastDigit === 2) ? 'nd' : (
($lastDigit === 3) ? 'rd' : 'th'
)
)
)
);
},
];
src/Carbon/Lang/en_AU.php 0000644 00000004524 15014555553 0011135 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'a year|:count years',
'y' => ':countyr|:countyrs',
'month' => 'a month|:count months',
'm' => ':countmo|:countmos',
'week' => 'a week|:count weeks',
'w' => ':countw|:countw',
'day' => 'a day|:count days',
'd' => ':countd|:countd',
'hour' => 'an hour|:count hours',
'h' => ':counth|:counth',
'minute' => 'a minute|:count minutes',
'min' => ':countm|:countm',
'second' => 'a few seconds|:count seconds',
's' => ':counts|:counts',
'ago' => ':time ago',
'from_now' => 'in :time',
'after' => ':time after',
'before' => ':time before',
'diff_now' => 'just now',
'diff_yesterday' => 'yesterday',
'diff_tomorrow' => 'tomorrow',
'diff_before_yesterday' => 'before yesterday',
'diff_after_tomorrow' => 'after tomorrow',
'period_recurrences' => 'once|:count times',
'period_interval' => 'every :interval',
'period_start_date' => 'from :date',
'period_end_date' => 'to :date',
'formats' => [
'LT' => 'h:mm A',
'LTS' => 'h:mm:ss A',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY h:mm A',
'LLLL' => 'dddd, D MMMM YYYY h:mm A',
],
'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'ordinal' => function ($number) {
$lastDigit = $number % 10;
return $number.(
(~~($number % 100 / 10) === 1) ? 'th' : (
($lastDigit === 1) ? 'st' : (
($lastDigit === 2) ? 'nd' : (
($lastDigit === 3) ? 'rd' : 'th'
)
)
)
);
},
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/en_CA.php 0000644 00000004423 15014555553 0011111 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'a year|:count years',
'y' => ':countyr|:countyrs',
'month' => 'a month|:count months',
'm' => ':countmo|:countmos',
'week' => 'a week|:count weeks',
'w' => ':countw|:countw',
'day' => 'a day|:count days',
'd' => ':countd|:countd',
'hour' => 'an hour|:count hours',
'h' => ':counth|:counth',
'minute' => 'a minute|:count minutes',
'min' => ':countm|:countm',
'second' => 'a few seconds|:count seconds',
's' => ':counts|:counts',
'ago' => ':time ago',
'from_now' => 'in :time',
'after' => ':time after',
'before' => ':time before',
'diff_now' => 'just now',
'diff_yesterday' => 'yesterday',
'diff_tomorrow' => 'tomorrow',
'diff_before_yesterday' => 'before yesterday',
'diff_after_tomorrow' => 'after tomorrow',
'period_recurrences' => 'once|:count times',
'period_interval' => 'every :interval',
'period_start_date' => 'from :date',
'period_end_date' => 'to :date',
'formats' => [
'LT' => 'h:mm A',
'LTS' => 'h:mm:ss A',
'L' => 'YYYY-MM-DD',
'LL' => 'MMMM D, YYYY',
'LLL' => 'MMMM D, YYYY h:mm A',
'LLLL' => 'dddd, MMMM D, YYYY h:mm A',
],
'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'ordinal' => function ($number) {
$lastDigit = $number % 10;
return $number.(
(~~($number % 100 / 10) === 1) ? 'th' : (
($lastDigit === 1) ? 'st' : (
($lastDigit === 2) ? 'nd' : (
($lastDigit === 3) ? 'rd' : 'th'
)
)
)
);
},
];
src/Carbon/Lang/en_GB.php 0000644 00000004520 15014555553 0011114 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'a year|:count years',
'y' => ':countyr|:countyrs',
'month' => 'a month|:count months',
'm' => ':countmo|:countmos',
'week' => 'a week|:count weeks',
'w' => ':countw|:countw',
'day' => 'a day|:count days',
'd' => ':countd|:countd',
'hour' => 'an hour|:count hours',
'h' => ':counth|:counth',
'minute' => 'a minute|:count minutes',
'min' => ':countm|:countm',
'second' => 'a few seconds|:count seconds',
's' => ':counts|:counts',
'ago' => ':time ago',
'from_now' => 'in :time',
'after' => ':time after',
'before' => ':time before',
'diff_now' => 'just now',
'diff_yesterday' => 'yesterday',
'diff_tomorrow' => 'tomorrow',
'diff_before_yesterday' => 'before yesterday',
'diff_after_tomorrow' => 'after tomorrow',
'period_recurrences' => 'once|:count times',
'period_interval' => 'every :interval',
'period_start_date' => 'from :date',
'period_end_date' => 'to :date',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'ordinal' => function ($number) {
$lastDigit = $number % 10;
return $number.(
(~~($number % 100 / 10) === 1) ? 'th' : (
($lastDigit === 1) ? 'st' : (
($lastDigit === 2) ? 'nd' : (
($lastDigit === 3) ? 'rd' : 'th'
)
)
)
);
},
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/en_IE.php 0000644 00000004517 15014555553 0011127 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'a year|:count years',
'y' => ':countyr|:countyrs',
'month' => 'a month|:count months',
'm' => ':countmo|:countmos',
'week' => 'a week|:count weeks',
'w' => ':countw|:countw',
'day' => 'a day|:count days',
'd' => ':countd|:countd',
'hour' => 'an hour|:count hours',
'h' => ':counth|:counth',
'minute' => 'a minute|:count minutes',
'min' => ':countm|:countm',
'second' => 'a few seconds|:count seconds',
's' => ':counts|:counts',
'ago' => ':time ago',
'from_now' => 'in :time',
'after' => ':time after',
'before' => ':time before',
'diff_now' => 'just now',
'diff_yesterday' => 'yesterday',
'diff_tomorrow' => 'tomorrow',
'diff_before_yesterday' => 'before yesterday',
'diff_after_tomorrow' => 'after tomorrow',
'period_recurrences' => 'once|:count times',
'period_interval' => 'every :interval',
'period_start_date' => 'from :date',
'period_end_date' => 'to :date',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD-MM-YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'ordinal' => function ($number) {
$lastDigit = $number % 10;
return $number.(
(~~($number % 100 / 10) === 1) ? 'th' : (
($lastDigit === 1) ? 'st' : (
($lastDigit === 2) ? 'nd' : (
($lastDigit === 3) ? 'rd' : 'th'
)
)
)
);
},
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/en_IL.php 0000644 00000005016 15014555553 0011131 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'a year|:count years',
'y' => ':countyr|:countyrs',
'month' => 'a month|:count months',
'm' => ':countmo|:countmos',
'week' => 'a week|:count weeks',
'w' => ':countw|:countw',
'day' => 'a day|:count days',
'd' => ':countd|:countd',
'hour' => 'an hour|:count hours',
'h' => ':counth|:counth',
'minute' => 'a minute|:count minutes',
'min' => ':countm|:countm',
'second' => 'a few seconds|:count seconds',
's' => ':counts|:counts',
'ago' => ':time ago',
'from_now' => 'in :time',
'after' => ':time after',
'before' => ':time before',
'diff_now' => 'just now',
'diff_yesterday' => 'yesterday',
'diff_tomorrow' => 'tomorrow',
'diff_before_yesterday' => 'before yesterday',
'diff_after_tomorrow' => 'after tomorrow',
'period_recurrences' => 'once|:count times',
'period_interval' => 'every :interval',
'period_start_date' => 'from :date',
'period_end_date' => 'to :date',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Today at] LT',
'nextDay' => '[Tomorrow at] LT',
'nextWeek' => 'dddd [at] LT',
'lastDay' => '[Yesterday at] LT',
'lastWeek' => '[Last] dddd [at] LT',
'sameElse' => 'L',
],
'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'ordinal' => function ($number) {
$lastDigit = $number % 10;
return $number.(
(~~($number % 100 / 10) === 1) ? 'th' : (
($lastDigit === 1) ? 'st' : (
($lastDigit === 2) ? 'nd' : (
($lastDigit === 3) ? 'rd' : 'th'
)
)
)
);
},
];
src/Carbon/Lang/en_NZ.php 0000644 00000005126 15014555553 0011156 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'a year|:count years',
'y' => ':countyr|:countyrs',
'month' => 'a month|:count months',
'm' => ':countmo|:countmos',
'week' => 'a week|:count weeks',
'w' => ':countw|:countw',
'day' => 'a day|:count days',
'd' => ':countd|:countd',
'hour' => 'an hour|:count hours',
'h' => ':counth|:counth',
'minute' => 'a minute|:count minutes',
'min' => ':countm|:countm',
'second' => 'a few seconds|:count seconds',
's' => ':counts|:counts',
'ago' => ':time ago',
'from_now' => 'in :time',
'after' => ':time after',
'before' => ':time before',
'diff_now' => 'just now',
'diff_yesterday' => 'yesterday',
'diff_tomorrow' => 'tomorrow',
'diff_before_yesterday' => 'before yesterday',
'diff_after_tomorrow' => 'after tomorrow',
'period_recurrences' => 'once|:count times',
'period_interval' => 'every :interval',
'period_start_date' => 'from :date',
'period_end_date' => 'to :date',
'formats' => [
'LT' => 'h:mm A',
'LTS' => 'h:mm:ss A',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY h:mm A',
'LLLL' => 'dddd, D MMMM YYYY h:mm A',
],
'calendar' => [
'sameDay' => '[Today at] LT',
'nextDay' => '[Tomorrow at] LT',
'nextWeek' => 'dddd [at] LT',
'lastDay' => '[Yesterday at] LT',
'lastWeek' => '[Last] dddd [at] LT',
'sameElse' => 'L',
],
'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'ordinal' => function ($number) {
$lastDigit = $number % 10;
return $number.(
(~~($number % 100 / 10) === 1) ? 'th' : (
($lastDigit === 1) ? 'st' : (
($lastDigit === 2) ? 'nd' : (
($lastDigit === 3) ? 'rd' : 'th'
)
)
)
);
},
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/eo.php 0000644 00000004365 15014555553 0010554 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'jaro|:count jaroj',
'y' => ':count jaro|:count jaroj',
'month' => 'monato|:count monatoj',
'm' => ':count monato|:count monatoj',
'week' => ':count semajno|:count semajnoj',
'w' => ':count semajno|:count semajnoj',
'day' => 'tago|:count tagoj',
'd' => ':count tago|:count tagoj',
'hour' => 'horo|:count horoj',
'h' => ':count horo|:count horoj',
'minute' => 'minuto|:count minutoj',
'min' => ':count minuto|:count minutoj',
'second' => 'sekundoj|:count sekundoj',
's' => ':count sekundo|:count sekundoj',
'ago' => 'antaŭ :time',
'from_now' => 'post :time',
'after' => ':time poste',
'before' => ':time antaŭe',
'diff_yesterday' => 'Hieraŭ',
'diff_tomorrow' => 'Morgaŭ',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY-MM-DD',
'LL' => 'D[-a de] MMMM, YYYY',
'LLL' => 'D[-a de] MMMM, YYYY HH:mm',
'LLLL' => 'dddd, [la] D[-a de] MMMM, YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Hodiaŭ je] LT',
'nextDay' => '[Morgaŭ je] LT',
'nextWeek' => 'dddd [je] LT',
'lastDay' => '[Hieraŭ je] LT',
'lastWeek' => '[pasinta] dddd [je] LT',
'sameElse' => 'L',
],
'ordinal' => ':numbera',
'meridiem' => function ($hour, $minute, $isLower) {
$meridiem = $hour < 12 ? 'a.t.m.' : 'p.t.m.';
return $isLower ? strtolower($meridiem) : $meridiem;
},
'months' => ['januaro', 'februaro', 'marto', 'aprilo', 'majo', 'junio', 'julio', 'aŭgusto', 'septembro', 'oktobro', 'novembro', 'decembro'],
'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aŭg', 'sep', 'okt', 'nov', 'dec'],
'weekdays' => ['dimanĉo', 'lundo', 'mardo', 'merkredo', 'ĵaŭdo', 'vendredo', 'sabato'],
'weekdays_short' => ['dim', 'lun', 'mard', 'merk', 'ĵaŭ', 'ven', 'sab'],
'weekdays_min' => ['di', 'lu', 'ma', 'me', 'ĵa', 've', 'sa'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/es.php 0000644 00000005417 15014555553 0010557 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un año|:count años',
'y' => ':count año|:count años',
'month' => 'un mes|:count meses',
'm' => ':count mes|:count meses',
'week' => ':count semana|:count semanas',
'w' => ':count semana|:count semanas',
'day' => 'un día|:count días',
'd' => ':count día|:count días',
'hour' => 'una hora|:count horas',
'h' => ':count hora|:count horas',
'minute' => 'un minuto|:count minutos',
'min' => ':count minuto|:count minutos',
'second' => 'unos segundos|:count segundos',
's' => ':count segundo|:count segundos',
'ago' => 'hace :time',
'from_now' => 'en :time',
'after' => ':time después',
'before' => ':time antes',
'diff_now' => 'ahora mismo',
'diff_yesterday' => 'ayer',
'diff_tomorrow' => 'mañana',
'diff_before_yesterday' => 'antier',
'diff_after_tomorrow' => 'pasado mañana',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D [de] MMMM [de] YYYY',
'LLL' => 'D [de] MMMM [de] YYYY H:mm',
'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm',
],
'calendar' => [
'sameDay' => function (\Carbon\CarbonInterface $current) {
return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'nextDay' => function (\Carbon\CarbonInterface $current) {
return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'nextWeek' => function (\Carbon\CarbonInterface $current) {
return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'lastDay' => function (\Carbon\CarbonInterface $current) {
return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'lastWeek' => function (\Carbon\CarbonInterface $current) {
return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'sameElse' => 'L',
],
'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
'mmm_suffix' => '.',
'ordinal' => ':numberº',
'weekdays' => ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'],
'weekdays_min' => ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/es_DO.php 0000644 00000004771 15014555553 0011143 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un año|:count años',
'month' => 'un mes|:count meses',
'week' => ':count semana|:count semanas',
'day' => 'un día|:count días',
'hour' => 'una hora|:count horas',
'minute' => 'un minuto|:count minutos',
'second' => 'unos segundos|:count segundos',
'ago' => 'hace :time',
'from_now' => 'en :time',
'after' => ':time después',
'before' => ':time antes',
'diff_now' => 'ahora mismo',
'diff_yesterday' => 'ayer',
'diff_tomorrow' => 'mañana',
'diff_before_yesterday' => 'anteayer',
'diff_after_tomorrow' => 'pasado mañana',
'formats' => [
'LT' => 'h:mm A',
'LTS' => 'h:mm:ss A',
'L' => 'DD/MM/YYYY',
'LL' => 'D [de] MMMM [de] YYYY',
'LLL' => 'D [de] MMMM [de] YYYY h:mm A',
'LLLL' => 'dddd, D [de] MMMM [de] YYYY h:mm A',
],
'calendar' => [
'sameDay' => function (\Carbon\CarbonInterface $current) {
return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'nextDay' => function (\Carbon\CarbonInterface $current) {
return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'nextWeek' => function (\Carbon\CarbonInterface $current) {
return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'lastDay' => function (\Carbon\CarbonInterface $current) {
return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'lastWeek' => function (\Carbon\CarbonInterface $current) {
return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'sameElse' => 'L',
],
'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
'mmm_suffix' => '.',
'ordinal' => ':numberº',
'weekdays' => ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'],
'weekdays_min' => ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/es_US.php 0000644 00000004665 15014555553 0011172 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un año|:count años',
'month' => 'un mes|:count meses',
'week' => ':count semana|:count semanas',
'day' => 'un día|:count días',
'hour' => 'una hora|:count horas',
'minute' => 'un minuto|:count minutos',
'second' => 'unos segundos|:count segundos',
'ago' => 'hace :time',
'from_now' => 'en :time',
'after' => ':time después',
'before' => ':time antes',
'diff_now' => 'ahora mismo',
'diff_yesterday' => 'ayer',
'diff_tomorrow' => 'mañana',
'diff_before_yesterday' => 'anteayer',
'diff_after_tomorrow' => 'pasado mañana',
'formats' => [
'LT' => 'h:mm A',
'LTS' => 'h:mm:ss A',
'L' => 'MM/DD/YYYY',
'LL' => 'MMMM [de] D [de] YYYY',
'LLL' => 'MMMM [de] D [de] YYYY h:mm A',
'LLLL' => 'dddd, MMMM [de] D [de] YYYY h:mm A',
],
'calendar' => [
'sameDay' => function (\Carbon\CarbonInterface $current) {
return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'nextDay' => function (\Carbon\CarbonInterface $current) {
return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'nextWeek' => function (\Carbon\CarbonInterface $current) {
return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'lastDay' => function (\Carbon\CarbonInterface $current) {
return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'lastWeek' => function (\Carbon\CarbonInterface $current) {
return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT';
},
'sameElse' => 'L',
],
'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
'mmm_suffix' => '.',
'ordinal' => ':numberº',
'weekdays' => ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'],
'weekdays_min' => ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'],
];
src/Carbon/Lang/et.php 0000644 00000002452 15014555553 0010554 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count aasta|:count aastat',
'y' => ':count aasta|:count aastat',
'month' => ':count kuu|:count kuud',
'm' => ':count kuu|:count kuud',
'week' => ':count nädal|:count nädalat',
'w' => ':count nädal|:count nädalat',
'day' => ':count päev|:count päeva',
'd' => ':count päev|:count päeva',
'hour' => ':count tund|:count tundi',
'h' => ':count tund|:count tundi',
'minute' => ':count minut|:count minutit',
'min' => ':count minut|:count minutit',
'second' => ':count sekund|:count sekundit',
's' => ':count sekund|:count sekundit',
'ago' => ':time tagasi',
'from_now' => ':time pärast',
'after' => ':time pärast',
'before' => ':time enne',
'year_from_now' => ':count aasta',
'month_from_now' => ':count kuu',
'week_from_now' => ':count nädala',
'day_from_now' => ':count päeva',
'hour_from_now' => ':count tunni',
'minute_from_now' => ':count minuti',
'second_from_now' => ':count sekundi',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/eu.php 0000644 00000004067 15014555553 0010561 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'urte bat|:count urte',
'y' => 'Urte 1|:count urte',
'month' => 'hilabete bat|:count hilabete',
'm' => 'Hile 1|:count hile',
'week' => 'Aste 1|:count aste',
'w' => 'Aste 1|:count aste',
'day' => 'egun bat|:count egun',
'd' => 'Egun 1|:count egun',
'hour' => 'ordu bat|:count ordu',
'h' => 'Ordu 1|:count ordu',
'minute' => 'minutu bat|:count minutu',
'min' => 'Minutu 1|:count minutu',
'second' => 'segundo batzuk|:count segundo',
's' => 'Segundu 1|:count segundu',
'ago' => 'duela :time',
'from_now' => ':time barru',
'after' => ':time geroago',
'before' => ':time lehenago',
'diff_yesterday' => 'atzo',
'diff_tomorrow' => 'bihar',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY-MM-DD',
'LL' => 'YYYY[ko] MMMM[ren] D[a]',
'LLL' => 'YYYY[ko] MMMM[ren] D[a] HH:mm',
'LLLL' => 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
],
'calendar' => [
'sameDay' => '[gaur] LT[etan]',
'nextDay' => '[bihar] LT[etan]',
'nextWeek' => 'dddd LT[etan]',
'lastDay' => '[atzo] LT[etan]',
'lastWeek' => '[aurreko] dddd LT[etan]',
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['urtarrila', 'otsaila', 'martxoa', 'apirila', 'maiatza', 'ekaina', 'uztaila', 'abuztua', 'iraila', 'urria', 'azaroa', 'abendua'],
'months_short' => ['urt.', 'ots.', 'mar.', 'api.', 'mai.', 'eka.', 'uzt.', 'abu.', 'ira.', 'urr.', 'aza.', 'abe.'],
'weekdays' => ['igandea', 'astelehena', 'asteartea', 'asteazkena', 'osteguna', 'ostirala', 'larunbata'],
'weekdays_short' => ['ig.', 'al.', 'ar.', 'az.', 'og.', 'ol.', 'lr.'],
'weekdays_min' => ['ig', 'al', 'ar', 'az', 'og', 'ol', 'lr'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/fa.php 0000644 00000004516 15014555553 0010535 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'یک سال|:count سال',
'y' => ':count سال',
'month' => 'یک ماه|:count ماه',
'm' => ':count ماه',
'week' => ':count هفته',
'w' => ':count هفته',
'day' => 'یک روز|:count روز',
'd' => ':count روز',
'hour' => 'یک ساعت|:count ساعت',
'h' => ':count ساعت',
'minute' => 'یک دقیقه|:count دقیقه',
'min' => ':count دقیقه',
'second' => 'چند ثانیه|ثانیه d%',
's' => ':count ثانیه',
'ago' => ':time پیش',
'from_now' => 'در :time',
'after' => ':time پس از',
'before' => ':time پیش از',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[امروز ساعت] LT',
'nextDay' => '[فردا ساعت] LT',
'nextWeek' => 'dddd [ساعت] LT',
'lastDay' => '[دیروز ساعت] LT',
'lastWeek' => 'dddd [پیش] [ساعت] LT',
'sameElse' => 'L',
],
'ordinal' => ':timeم',
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'قبل از ظهر' : 'بعد از ظهر';
},
'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'],
'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'],
'weekdays' => ['یکu200cشنبه', 'دوشنبه', 'سهu200cشنبه', 'چهارشنبه', 'پنجu200cشنبه', 'جمعه', 'شنبه'],
'weekdays_short' => ['یکu200cشنبه', 'دوشنبه', 'سهu200cشنبه', 'چهارشنبه', 'پنجu200cشنبه', 'جمعه', 'شنبه'],
'weekdays_min' => ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/fi.php 0000644 00000002115 15014555553 0010536 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count vuosi|:count vuotta',
'y' => ':count vuosi|:count vuotta',
'month' => ':count kuukausi|:count kuukautta',
'm' => ':count kuukausi|:count kuukautta',
'week' => ':count viikko|:count viikkoa',
'w' => ':count viikko|:count viikkoa',
'day' => ':count päivä|:count päivää',
'd' => ':count päivä|:count päivää',
'hour' => ':count tunti|:count tuntia',
'h' => ':count tunti|:count tuntia',
'minute' => ':count minuutti|:count minuuttia',
'min' => ':count minuutti|:count minuuttia',
'second' => ':count sekunti|:count sekuntia',
's' => ':count sekunti|:count sekuntia',
'ago' => ':time sitten',
'from_now' => ':time tästä hetkestä',
'after' => ':time sen jälkeen',
'before' => ':time ennen',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/fo.php 0000644 00000004017 15014555553 0010547 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'eitt ár|:count ár',
'y' => ':count ár|:count ár',
'month' => 'ein mánaði|:count mánaðir',
'm' => ':count mánaður|:count mánaðir',
'week' => ':count vika|:count vikur',
'w' => ':count vika|:count vikur',
'day' => 'ein dagur|:count dagar',
'd' => ':count dag|:count dagar',
'hour' => 'ein tími|:count tímar',
'h' => ':count tími|:count tímar',
'minute' => 'ein minutt|:count minuttir',
'min' => ':count minutt|:count minuttir',
'second' => 'fá sekund|:count sekundir',
's' => ':count sekund|:count sekundir',
'ago' => ':time síðani',
'from_now' => 'um :time',
'after' => ':time aftaná',
'before' => ':time áðrenn',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D. MMMM, YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Í dag kl.] LT',
'nextDay' => '[Í morgin kl.] LT',
'nextWeek' => 'dddd [kl.] LT',
'lastDay' => '[Í gjár kl.] LT',
'lastWeek' => '[síðstu] dddd [kl] LT',
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['januar', 'februar', 'mars', 'apríl', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'],
'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'],
'weekdays' => ['sunnudagur', 'mánadagur', 'týsdagur', 'mikudagur', 'hósdagur', 'fríggjadagur', 'leygardagur'],
'weekdays_short' => ['sun', 'mán', 'týs', 'mik', 'hós', 'frí', 'ley'],
'weekdays_min' => ['su', 'má', 'tý', 'mi', 'hó', 'fr', 'le'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/fr.php 0000644 00000005607 15014555553 0010560 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un an|:count ans',
'y' => ':count an|:count ans',
'month' => 'un mois|:count mois',
'm' => ':count mois',
'week' => ':count semaine|:count semaines',
'w' => ':count sem.',
'day' => 'un jour|:count jours',
'd' => ':count j.',
'hour' => 'une heure|:count heures',
'h' => ':count h.',
'minute' => 'une minute|:count minutes',
'min' => ':count min.',
'second' => 'quelques secondes|:count secondes',
's' => ':count sec.',
'ago' => 'il y a :time',
'from_now' => 'dans :time',
'after' => ':time après',
'before' => ':time avant',
'diff_now' => 'à l\'instant',
'diff_yesterday' => 'hier',
'diff_tomorrow' => 'demain',
'diff_before_yesterday' => 'avant-hier',
'diff_after_tomorrow' => 'après-demain',
'period_recurrences' => ':count fois',
'period_interval' => 'tous les :interval',
'period_start_date' => 'de :date',
'period_end_date' => 'à :date',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Aujourd’hui à] LT',
'nextDay' => '[Demain à] LT',
'nextWeek' => 'dddd [à] LT',
'lastDay' => '[Hier à] LT',
'lastWeek' => 'dddd [dernier à] LT',
'sameElse' => 'L',
],
'months' => ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
'months_short' => ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
'weekdays' => ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
'weekdays_short' => ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
'weekdays_min' => ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'],
'ordinal' => function ($number, $period) {
switch ($period) {
// In french, only the first has be ordinal, other number remains cardinal
// @link https://fr.wikihow.com/%C3%A9crire-la-date-en-fran%C3%A7ais
case 'D':
return $number.($number === 1 ? 'er' : '');
default:
case 'M':
case 'Q':
case 'DDD':
case 'd':
return $number.($number === 1 ? 'er' : 'e');
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return $number.($number === 1 ? 're' : 'e');
}
},
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/fr_CA.php 0000644 00000005503 15014555553 0011116 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un an|:count ans',
'y' => ':count an|:count ans',
'month' => 'un mois|:count mois',
'm' => ':count mois',
'week' => ':count semaine|:count semaines',
'w' => ':count sem.',
'day' => 'un jour|:count jours',
'd' => ':count j.',
'hour' => 'une heure|:count heures',
'h' => ':count h.',
'minute' => 'une minute|:count minutes',
'min' => ':count min.',
'second' => 'quelques secondes|:count secondes',
's' => ':count sec.',
'ago' => 'il y a :time',
'from_now' => 'dans :time',
'after' => ':time après',
'before' => ':time avant',
'diff_now' => 'à l\'instant',
'diff_yesterday' => 'hier',
'diff_tomorrow' => 'demain',
'diff_before_yesterday' => 'avant-hier',
'diff_after_tomorrow' => 'après-demain',
'period_recurrences' => ':count fois',
'period_interval' => 'tous les :interval',
'period_start_date' => 'de :date',
'period_end_date' => 'à :date',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY-MM-DD',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Aujourd’hui à] LT',
'nextDay' => '[Demain à] LT',
'nextWeek' => 'dddd [à] LT',
'lastDay' => '[Hier à] LT',
'lastWeek' => 'dddd [dernier à] LT',
'sameElse' => 'L',
],
'months' => ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
'months_short' => ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
'weekdays' => ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
'weekdays_short' => ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
'weekdays_min' => ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'],
'ordinal' => function ($number, $period) {
switch ($period) {
// In french, only the first has be ordinal, other number remains cardinal
// @link https://fr.wikihow.com/%C3%A9crire-la-date-en-fran%C3%A7ais
case 'D':
return $number.($number === 1 ? 'er' : '');
default:
case 'M':
case 'Q':
case 'DDD':
case 'd':
return $number.($number === 1 ? 'er' : 'e');
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return $number.($number === 1 ? 're' : 'e');
}
},
];
src/Carbon/Lang/fr_CH.php 0000644 00000005607 15014555553 0011132 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un an|:count ans',
'y' => ':count an|:count ans',
'month' => 'un mois|:count mois',
'm' => ':count mois',
'week' => ':count semaine|:count semaines',
'w' => ':count sem.',
'day' => 'un jour|:count jours',
'd' => ':count j.',
'hour' => 'une heure|:count heures',
'h' => ':count h.',
'minute' => 'une minute|:count minutes',
'min' => ':count min.',
'second' => 'quelques secondes|:count secondes',
's' => ':count sec.',
'ago' => 'il y a :time',
'from_now' => 'dans :time',
'after' => ':time après',
'before' => ':time avant',
'diff_now' => 'à l\'instant',
'diff_yesterday' => 'hier',
'diff_tomorrow' => 'demain',
'diff_before_yesterday' => 'avant-hier',
'diff_after_tomorrow' => 'après-demain',
'period_recurrences' => ':count fois',
'period_interval' => 'tous les :interval',
'period_start_date' => 'de :date',
'period_end_date' => 'à :date',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Aujourd’hui à] LT',
'nextDay' => '[Demain à] LT',
'nextWeek' => 'dddd [à] LT',
'lastDay' => '[Hier à] LT',
'lastWeek' => 'dddd [dernier à] LT',
'sameElse' => 'L',
],
'months' => ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
'months_short' => ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
'weekdays' => ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
'weekdays_short' => ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
'weekdays_min' => ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'],
'ordinal' => function ($number, $period) {
switch ($period) {
// In french, only the first has be ordinal, other number remains cardinal
// @link https://fr.wikihow.com/%C3%A9crire-la-date-en-fran%C3%A7ais
case 'D':
return $number.($number === 1 ? 'er' : '');
default:
case 'M':
case 'Q':
case 'DDD':
case 'd':
return $number.($number === 1 ? 'er' : 'e');
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return $number.($number === 1 ? 're' : 'e');
}
},
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/fr_FR.php 0000644 00000000412 15014555553 0011134 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return require __DIR__.'/fr.php';
src/Carbon/Lang/fy.php 0000644 00000003520 15014555553 0010557 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'ien jier|:count jierren',
'month' => 'ien moanne|:count moannen',
'week' => 'in wike|:count wiken',
'day' => 'ien dei|:count dagen',
'hour' => 'ien oere|:count oeren',
'minute' => 'ien minút|:count minuten',
'second' => 'in pear sekonden|:count sekonden',
'ago' => ':time lyn',
'from_now' => 'oer :time',
'diff_yesterday' => 'juster',
'diff_tomorrow' => 'moarn',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD-MM-YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[hjoed om] LT',
'nextDay' => '[moarn om] LT',
'nextWeek' => 'dddd [om] LT',
'lastDay' => '[juster om] LT',
'lastWeek' => '[ôfrûne] dddd [om] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de');
},
'months' => ['jannewaris', 'febrewaris', 'maart', 'april', 'maaie', 'juny', 'july', 'augustus', 'septimber', 'oktober', 'novimber', 'desimber'],
'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'],
'mmm_suffix' => '.',
'weekdays' => ['snein', 'moandei', 'tiisdei', 'woansdei', 'tongersdei', 'freed', 'sneon'],
'weekdays_short' => ['si.', 'mo.', 'ti.', 'wo.', 'to.', 'fr.', 'so.'],
'weekdays_min' => ['Si', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'So'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/gd.php 0000644 00000004036 15014555553 0010536 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'gd');
return [
'year' => 'bliadhna|:count bliadhna',
'month' => 'mìos|:count mìosan',
'week' => 'seachdain|:count seachdainean',
'day' => 'latha|:count latha',
'hour' => 'uair|:count uairean',
'minute' => 'mionaid|:count mionaidean',
'second' => 'beagan diogan|:count diogan',
'ago' => 'bho chionn :time',
'from_now' => 'ann an :time',
'diff_yesterday' => 'An-dè',
'diff_tomorrow' => 'A-màireach',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[An-diugh aig] LT',
'nextDay' => '[A-màireach aig] LT',
'nextWeek' => 'dddd [aig] LT',
'lastDay' => '[An-dè aig] LT',
'lastWeek' => 'dddd [seo chaidh] [aig] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
return $number.($number === 1 ? 'd' : ($number % 10 === 2 ? 'na' : 'mh'));
},
'months' => ['Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'],
'months_short' => ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'],
'weekdays' => ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'],
'weekdays_short' => ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'],
'weekdays_min' => ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/gl.php 0000644 00000004632 15014555553 0010550 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un ano|:count anos',
'month' => 'un mes|:count meses',
'week' => ':count semana|:count semanas',
'day' => 'un día|:count días',
'hour' => 'unha hora|:count horas',
'minute' => 'un minuto|:count minutos',
'second' => 'uns segundos|:count segundos',
'ago' => 'hai :time',
'from_now' => function ($time) {
if (substr($time, 0, 2) === 'un') {
return "n$time";
}
return "en $time";
},
'after' => ':time despois',
'before' => ':time antes',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D [de] MMMM [de] YYYY',
'LLL' => 'D [de] MMMM [de] YYYY H:mm',
'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm',
],
'calendar' => [
'sameDay' => function (\Carbon\CarbonInterface $current) {
return '[hoxe '.($current->hour !== 1 ? 'ás' : 'á').'] LT';
},
'nextDay' => function (\Carbon\CarbonInterface $current) {
return '[mañá '.($current->hour !== 1 ? 'ás' : 'á').'] LT';
},
'nextWeek' => function (\Carbon\CarbonInterface $current) {
return 'dddd ['.($current->hour !== 1 ? 'ás' : 'á').'] LT';
},
'lastDay' => function (\Carbon\CarbonInterface $current) {
return '[onte '.($current->hour !== 1 ? 'á' : 'a').'] LT';
},
'lastWeek' => function (\Carbon\CarbonInterface $current) {
return '[o] dddd [pasado '.($current->hour !== 1 ? 'ás' : 'á').'] LT';
},
'sameElse' => 'L',
],
'ordinal' => ':numberº',
'months' => ['xaneiro', 'febreiro', 'marzo', 'abril', 'maio', 'xuño', 'xullo', 'agosto', 'setembro', 'outubro', 'novembro', 'decembro'],
'months_short' => ['xan.', 'feb.', 'mar.', 'abr.', 'mai.', 'xuñ.', 'xul.', 'ago.', 'set.', 'out.', 'nov.', 'dec.'],
'weekdays' => ['domingo', 'luns', 'martes', 'mércores', 'xoves', 'venres', 'sábado'],
'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mér.', 'xov.', 'ven.', 'sáb.'],
'weekdays_min' => ['do', 'lu', 'ma', 'mé', 'xo', 've', 'sá'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/gom_Latn.php 0000644 00000004357 15014555553 0011712 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count voros|:count vorsam',
'y' => ':countv',
'month' => ':count mhoino|:count mhoine',
'm' => ':countmh',
'week' => ':count satolleacho|:count satolleache',
'w' => ':countsa|:countsa',
'day' => ':count dis',
'd' => ':countd',
'hour' => ':count hor|:count horam',
'h' => ':counth',
'minute' => ':count minute|:count mintam',
'min' => ':countm',
'second' => '::count second',
's' => ':counts',
'formats' => [
'LT' => 'A h:mm [vazta]',
'LTS' => 'A h:mm:ss [vazta]',
'L' => 'DD-MM-YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY A h:mm [vazta]',
'LLLL' => 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]',
'llll' => 'ddd, D MMM YYYY, A h:mm [vazta]',
],
'calendar' => [
'sameDay' => '[Aiz] LT',
'nextDay' => '[Faleam] LT',
'nextWeek' => '[Ieta to] dddd[,] LT',
'lastDay' => '[Kal] LT',
'lastWeek' => '[Fatlo] dddd[,] LT',
'sameElse' => 'L',
],
'months' => ['Janer', 'Febrer', 'Mars', 'Abril', 'Mai', 'Jun', 'Julai', 'Agost', 'Setembr', 'Otubr', 'Novembr', 'Dezembr'],
'months_short' => ['Jan.', 'Feb.', 'Mars', 'Abr.', 'Mai', 'Jun', 'Jul.', 'Ago.', 'Set.', 'Otu.', 'Nov.', 'Dez.'],
'weekdays' => ['Aitar', 'Somar', 'Mongllar', 'Budvar', 'Brestar', 'Sukrar', 'Son\'var'],
'weekdays_short' => ['Ait.', 'Som.', 'Mon.', 'Bud.', 'Bre.', 'Suk.', 'Son.'],
'weekdays_min' => ['Ai', 'Sm', 'Mo', 'Bu', 'Br', 'Su', 'Sn'],
'ordinal' => function ($number, $period) {
return $number.($period === 'D' ? 'er' : '');
},
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'rati';
}
if ($hour < 12) {
return 'sokalli';
}
if ($hour < 16) {
return 'donparam';
}
if ($hour < 20) {
return 'sanje';
}
return 'rati';
},
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/gu.php 0000644 00000006055 15014555553 0010562 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'એક વર્ષ|:count વર્ષ',
'y' => ':countવર્ષ|:countવર્ષો',
'month' => 'એક મહિનો|:count મહિનો',
'm' => ':countમહિનો|:countમહિના',
'week' => ':count અઠવાડિયું|:count અઠવાડિયા',
'w' => ':countઅઠ.|:countઅઠ.',
'day' => 'એક દિવસ|:count દિવસ',
'd' => ':countદિ.|:countદિ.',
'hour' => 'એક કલાક|:count કલાક',
'h' => ':countક.|:countક.',
'minute' => 'એક મિનિટ|:count મિનિટ',
'min' => ':countમિ.|:countમિ.',
'second' => 'અમુક પળો|:count સેકંડ',
's' => ':countસે.|:countસે.',
'ago' => ':time પેહલા',
'from_now' => ':time મા',
'after' => ':time પછી',
'before' => ':time પહેલા',
'diff_yesterday' => 'ગઇકાલે',
'diff_tomorrow' => 'કાલે',
'formats' => [
'LT' => 'A h:mm વાગ્યે',
'LTS' => 'A h:mm:ss વાગ્યે',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, A h:mm વાગ્યે',
'LLLL' => 'dddd, D MMMM YYYY, A h:mm વાગ્યે',
],
'calendar' => [
'sameDay' => '[આજ] LT',
'nextDay' => '[કાલે] LT',
'nextWeek' => 'dddd, LT',
'lastDay' => '[ગઇકાલે] LT',
'lastWeek' => '[પાછલા] dddd, LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'રાત';
}
if ($hour < 10) {
return 'સવાર';
}
if ($hour < 17) {
return 'બપોર';
}
if ($hour < 20) {
return 'સાંજ';
}
return 'રાત';
},
'months' => ['જાન્યુઆરી', 'ફેબ્રુઆરી', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટેમ્બર', 'ઑક્ટ્બર', 'નવેમ્બર', 'ડિસેમ્બર'],
'months_short' => ['જાન્યુ.', 'ફેબ્રુ.', 'માર્ચ', 'એપ્રિ.', 'મે', 'જૂન', 'જુલા.', 'ઑગ.', 'સપ્ટે.', 'ઑક્ટ્.', 'નવે.', 'ડિસે.'],
'weekdays' => ['રવિવાર', 'સોમવાર', 'મંગળવાર', 'બુધ્વાર', 'ગુરુવાર', 'શુક્રવાર', 'શનિવાર'],
'weekdays_short' => ['રવિ', 'સોમ', 'મંગળ', 'બુધ્', 'ગુરુ', 'શુક્ર', 'શનિ'],
'weekdays_min' => ['ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ'],
];
src/Carbon/Lang/he.php 0000644 00000005271 15014555553 0010542 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'שנה|{2}שנתיים|:count שנים',
'y' => 'שנה|{2}שנתיים|:count שנים',
'month' => 'חודש|{2}חודשיים|:count חודשים',
'm' => 'חודש|{2}חודשיים|:count חודשים',
'week' => 'שבוע|{2}שבועיים|:count שבועות',
'w' => 'שבוע|{2}שבועיים|:count שבועות',
'day' => 'יום|{2}יומיים|:count ימים',
'd' => 'יום|{2}יומיים|:count ימים',
'hour' => 'שעה|{2}שעתיים|:count שעות',
'h' => 'שעה|{2}שעתיים|:count שעות',
'minute' => 'דקה|{2}דקותיים|:count דקות',
'min' => 'דקה|{2}דקותיים|:count דקות',
'second' => 'שניה|:count שניות',
's' => 'שניה|:count שניות',
'ago' => 'לפני :time',
'from_now' => 'בעוד :time',
'after' => 'אחרי :time',
'before' => 'לפני :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D [ב]MMMM YYYY',
'LLL' => 'D [ב]MMMM YYYY HH:mm',
'LLLL' => 'dddd, D [ב]MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[היום ב־]LT',
'nextDay' => '[מחר ב־]LT',
'nextWeek' => 'dddd [בשעה] LT',
'lastDay' => '[אתמול ב־]LT',
'lastWeek' => '[ביום] dddd [האחרון בשעה] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 5) {
return 'לפנות בוקר';
}
if ($hour < 10) {
return 'בבוקר';
}
if ($hour < 12) {
return $isLower ? 'לפנה"צ' : 'לפני הצהריים';
}
if ($hour < 18) {
return $isLower ? 'אחה"צ' : 'אחרי הצהריים';
}
return 'בערב';
},
'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'],
'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'],
'weekdays' => ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'],
'weekdays_short' => ['א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳'],
'weekdays_min' => ['א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש'],
];
src/Carbon/Lang/hi.php 0000644 00000005704 15014555553 0010547 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'एक वर्ष|:count वर्ष',
'y' => '1 वर्ष|:count वर्षों',
'month' => 'एक महीने|:count महीने',
'm' => '1 माह|:count महीने',
'week' => '1 सप्ताह|:count सप्ताह',
'w' => '1 सप्ताह|:count सप्ताह',
'day' => 'एक दिन|:count दिन',
'd' => '1 दिन|:count दिनों',
'hour' => 'एक घंटा|:count घंटे',
'h' => '1 घंटा|:count घंटे',
'minute' => 'एक मिनट|:count मिनट',
'min' => '1 मिनट|:count मिनटों',
'second' => 'कुछ ही क्षण|:count सेकंड',
's' => '1 सेकंड|:count सेकंड',
'ago' => ':time पहले',
'from_now' => ':time में',
'after' => ':time के बाद',
'before' => ':time के पहले',
'diff_yesterday' => 'कल',
'diff_tomorrow' => 'कल',
'formats' => [
'LT' => 'A h:mm बजे',
'LTS' => 'A h:mm:ss बजे',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, A h:mm बजे',
'LLLL' => 'dddd, D MMMM YYYY, A h:mm बजे',
],
'calendar' => [
'sameDay' => '[आज] LT',
'nextDay' => '[कल] LT',
'nextWeek' => 'dddd, LT',
'lastDay' => '[कल] LT',
'lastWeek' => '[पिछले] dddd, LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'रात';
}
if ($hour < 10) {
return 'सुबह';
}
if ($hour < 17) {
return 'दोपहर';
}
if ($hour < 20) {
return 'शाम';
}
return 'रात';
},
'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'],
'months_short' => ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'],
'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'],
'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'],
'weekdays_min' => ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'],
];
src/Carbon/Lang/hr.php 0000644 00000006212 15014555553 0010553 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count godinu|:count godine|:count godina',
'y' => ':count godinu|:count godine|:count godina',
'month' => ':count mjesec|:count mjeseca|:count mjeseci',
'm' => ':count mjesec|:count mjeseca|:count mjeseci',
'week' => ':count tjedan|:count tjedna|:count tjedana',
'w' => ':count tjedan|:count tjedna|:count tjedana',
'day' => ':count dan|:count dana|:count dana',
'd' => ':count dan|:count dana|:count dana',
'hour' => ':count sat|:count sata|:count sati',
'h' => ':count sat|:count sata|:count sati',
'minute' => ':count minutu|:count minute |:count minuta',
'min' => ':count minutu|:count minute |:count minuta',
'second' => ':count sekundu|:count sekunde|:count sekundi',
's' => ':count sekundu|:count sekunde|:count sekundi',
'ago' => 'prije :time',
'from_now' => 'za :time',
'after' => 'za :time',
'before' => 'prije :time',
'diff_yesterday' => 'jučer',
'diff_tomorrow' => 'sutra',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY H:mm',
'LLLL' => 'dddd, D. MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[danas u] LT',
'nextDay' => '[sutra u] LT',
'nextWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
default:
return '[u] dddd [u] LT';
}
},
'lastDay' => '[jučer u] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
case 3:
return '[prošlu] dddd [u] LT';
case 6:
return '[prošle] [subote] [u] LT';
default:
return '[prošli] dddd [u] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['siječnja', 'veljače', 'ožujka', 'travnja', 'svibnja', 'lipnja', 'srpnja', 'kolovoza', 'rujna', 'listopada', 'studenoga', 'prosinca'],
'months_standalone' => ['siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac'],
'months_short' => ['sij.', 'velj.', 'ožu.', 'tra.', 'svi.', 'lip.', 'srp.', 'kol.', 'ruj.', 'lis.', 'stu.', 'pro.'],
'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'],
'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'],
'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/hu.php 0000644 00000003163 15014555553 0010560 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count év',
'y' => ':count év',
'month' => ':count hónap',
'm' => ':count hónap',
'week' => ':count hét',
'w' => ':count hét',
'day' => ':count nap',
'd' => ':count nap',
'hour' => ':count óra',
'h' => ':count óra',
'minute' => ':count perc',
'min' => ':count perc',
'second' => ':count másodperc',
's' => ':count másodperc',
'ago' => ':time',
'from_now' => ':time múlva',
'after' => ':time később',
'before' => ':time korábban',
'year_ago' => ':count éve',
'month_ago' => ':count hónapja',
'week_ago' => ':count hete',
'day_ago' => ':count napja',
'hour_ago' => ':count órája',
'minute_ago' => ':count perce',
'second_ago' => ':count másodperce',
'year_after' => ':count évvel',
'month_after' => ':count hónappal',
'week_after' => ':count héttel',
'day_after' => ':count nappal',
'hour_after' => ':count órával',
'minute_after' => ':count perccel',
'second_after' => ':count másodperccel',
'year_before' => ':count évvel',
'month_before' => ':count hónappal',
'week_before' => ':count héttel',
'day_before' => ':count nappal',
'hour_before' => ':count órával',
'minute_before' => ':count perccel',
'second_before' => ':count másodperccel',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/hy.php 0000644 00000005700 15014555553 0010563 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'տարի|:count տարի',
'y' => ':countտ',
'month' => 'ամիս|:count ամիս',
'm' => ':countամ',
'week' => ':count շաբաթ',
'w' => ':countշ',
'day' => 'օր|:count օր',
'd' => ':countօր',
'hour' => 'ժամ|:count ժամ',
'h' => ':countժ',
'minute' => 'րոպե|:count րոպե',
'min' => ':countր',
'second' => 'մի քանի վայրկյան|:count վայրկյան',
's' => ':countվրկ',
'ago' => ':time առաջ',
'from_now' => ':time ներկա պահից',
'after' => ':time հետո',
'before' => ':time առաջ',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY թ.',
'LLL' => 'D MMMM YYYY թ., HH:mm',
'LLLL' => 'dddd, D MMMM YYYY թ., HH:mm',
],
'calendar' => [
'sameDay' => '[այսօր] LT',
'nextDay' => '[վաղը] LT',
'nextWeek' => 'dddd [օրը ժամը] LT',
'lastDay' => '[երեկ] LT',
'lastWeek' => '[անցած] dddd [օրը ժամը] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'DDD':
case 'w':
case 'W':
case 'DDDo':
return $number.($number === 1 ? '-ին' : '-րդ');
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'գիշերվա';
}
if ($hour < 12) {
return 'առավոտվա';
}
if ($hour < 17) {
return 'ցերեկվա';
}
return 'երեկոյան';
},
'months' => ['հունվարի', 'փետրվարի', 'մարտի', 'ապրիլի', 'մայիսի', 'հունիսի', 'հուլիսի', 'օգոստոսի', 'սեպտեմբերի', 'հոկտեմբերի', 'նոյեմբերի', 'դեկտեմբերի'],
'months_standalone' => ['հունվար', 'փետրվար', 'մարտ', 'ապրիլ', 'մայիս', 'հունիս', 'հուլիս', 'օգոստոս', 'սեպտեմբեր', 'հոկտեմբեր', 'նոյեմբեր', 'դեկտեմբեր'],
'months_short' => ['հնվ', 'փտր', 'մրտ', 'ապր', 'մյս', 'հնս', 'հլս', 'օգս', 'սպտ', 'հկտ', 'նմբ', 'դկտ'],
'weekdays' => ['կիրակի', 'երկուշաբթի', 'երեքշաբթի', 'չորեքշաբթի', 'հինգշաբթի', 'ուրբաթ', 'շաբաթ'],
'weekdays_short' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'],
'weekdays_min' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'],
];
src/Carbon/Lang/hy_AM.php 0000644 00000006076 15014555553 0011147 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'տարի|:count տարի',
'y' => ':countտ',
'month' => 'ամիս|:count ամիս',
'm' => ':countամ',
'week' => ':count շաբաթ',
'w' => ':countշ',
'day' => 'օր|:count օր',
'd' => ':countօր',
'hour' => 'ժամ|:count ժամ',
'h' => ':countժ',
'minute' => 'րոպե|:count րոպե',
'min' => ':countր',
'second' => 'մի քանի վայրկյան|:count վայրկյան',
's' => ':countվրկ',
'ago' => ':time առաջ',
'from_now' => ':time հետո',
'after' => ':time հետո',
'before' => ':time առաջ',
'diff_yesterday' => 'երեկ',
'diff_tomorrow' => 'վաղը',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY թ.',
'LLL' => 'D MMMM YYYY թ., HH:mm',
'LLLL' => 'dddd, D MMMM YYYY թ., HH:mm',
],
'calendar' => [
'sameDay' => '[այսօր] LT',
'nextDay' => '[վաղը] LT',
'nextWeek' => 'dddd [օրը ժամը] LT',
'lastDay' => '[երեկ] LT',
'lastWeek' => '[անցած] dddd [օրը ժամը] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'DDD':
case 'w':
case 'W':
case 'DDDo':
return $number.($number === 1 ? '-ին' : '-րդ');
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'գիշերվա';
}
if ($hour < 12) {
return 'առավոտվա';
}
if ($hour < 17) {
return 'ցերեկվա';
}
return 'երեկոյան';
},
'months' => ['հունվարի', 'փետրվարի', 'մարտի', 'ապրիլի', 'մայիսի', 'հունիսի', 'հուլիսի', 'օգոստոսի', 'սեպտեմբերի', 'հոկտեմբերի', 'նոյեմբերի', 'դեկտեմբերի'],
'months_standalone' => ['հունվար', 'փետրվար', 'մարտ', 'ապրիլ', 'մայիս', 'հունիս', 'հուլիս', 'օգոստոս', 'սեպտեմբեր', 'հոկտեմբեր', 'նոյեմբեր', 'դեկտեմբեր'],
'months_short' => ['հնվ', 'փտր', 'մրտ', 'ապր', 'մյս', 'հնս', 'հլս', 'օգս', 'սպտ', 'հկտ', 'նմբ', 'դկտ'],
'weekdays' => ['կիրակի', 'երկուշաբթի', 'երեքշաբթի', 'չորեքշաբթի', 'հինգշաբթի', 'ուրբաթ', 'շաբաթ'],
'weekdays_short' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'],
'weekdays_min' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/id.php 0000644 00000004247 15014555553 0010544 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}setahun|]1,Inf[:count tahun',
'y' => ':count tahun',
'month' => '{1}sebulan|]1,Inf[:count bulan',
'm' => ':count bulan',
'week' => ':count minggu',
'w' => ':count minggu',
'day' => '{1}sehari|]1,Inf[:count hari',
'd' => ':count hari',
'hour' => '{1}sejam|]1,Inf[:count jam',
'h' => ':count jam',
'minute' => '{1}semenit|]1,Inf[:count menit',
'min' => ':count menit',
'second' => '{1}beberapa detik|]1,Inf[:count detik',
's' => ':count detik',
'ago' => ':time yang lalu',
'from_now' => 'dalam :time',
'after' => ':time setelah',
'before' => ':time sebelum',
'formats' => [
'LT' => 'HH.mm',
'LTS' => 'HH.mm.ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY [pukul] HH.mm',
'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm',
],
'calendar' => [
'sameDay' => '[Hari ini pukul] LT',
'nextDay' => '[Besok pukul] LT',
'nextWeek' => 'dddd [pukul] LT',
'lastDay' => '[Kemarin pukul] LT',
'lastWeek' => 'dddd [lalu pukul] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 11) {
return 'pagi';
}
if ($hour < 15) {
return 'siang';
}
if ($hour < 19) {
return 'sore';
}
return 'malam';
},
'months' => ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agt', 'Sep', 'Okt', 'Nov', 'Des'],
'weekdays' => ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'],
'weekdays_short' => ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
'weekdays_min' => ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/is.php 0000644 00000001767 15014555553 0010567 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '1 ár|:count ár',
'y' => '1 ár|:count ár',
'month' => '1 mánuður|:count mánuðir',
'm' => '1 mánuður|:count mánuðir',
'week' => '1 vika|:count vikur',
'w' => '1 vika|:count vikur',
'day' => '1 dagur|:count dagar',
'd' => '1 dagur|:count dagar',
'hour' => '1 klukkutími|:count klukkutímar',
'h' => '1 klukkutími|:count klukkutímar',
'minute' => '1 mínúta|:count mínútur',
'min' => '1 mínúta|:count mínútur',
'second' => '1 sekúnda|:count sekúndur',
's' => '1 sekúnda|:count sekúndur',
'ago' => ':time síðan',
'from_now' => ':time síðan',
'after' => ':time eftir',
'before' => ':time fyrir',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/it.php 0000644 00000004763 15014555553 0010567 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un anno|:count anni',
'y' => ':count anno|:count anni',
'month' => 'un mese|:count mesi',
'm' => ':count mese|:count mesi',
'week' => ':count settimana|:count settimane',
'w' => ':count settimana|:count settimane',
'day' => 'un giorno|:count giorni',
'd' => ':count giorno|:count giorni',
'hour' => 'un\'ora|:count ore',
'h' => ':count ora|:count ore',
'minute' => 'un minuto|:count minuti',
'min' => ':count minuto|:count minuti',
'second' => 'alcuni secondi|:count secondi',
's' => ':count secondo|:count secondi',
'ago' => ':time fa',
'from_now' => function ($time) {
return (preg_match('/^[0-9].+$/', $time) ? 'tra' : 'in')." $time";
},
'after' => ':time dopo',
'before' => ':time prima',
'diff_now' => 'proprio ora',
'diff_yesterday' => 'ieri',
'diff_tomorrow' => 'domani',
'diff_before_yesterday' => 'l\'altro ieri',
'diff_after_tomorrow' => 'dopodomani',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Oggi alle] LT',
'nextDay' => '[Domani alle] LT',
'nextWeek' => 'dddd [alle] LT',
'lastDay' => '[Ieri alle] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[la scorsa] dddd [alle] LT';
default:
return '[lo scorso] dddd [alle] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':numberº',
'months' => ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'],
'months_short' => ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'],
'weekdays' => ['domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato'],
'weekdays_short' => ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'],
'weekdays_min' => ['do', 'lu', 'ma', 'me', 'gi', 've', 'sa'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/ja.php 0000644 00000005016 15014555553 0010535 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count年',
'y' => ':count年',
'month' => ':countヶ月',
'm' => ':countヶ月',
'week' => ':count週間',
'w' => ':count週間',
'day' => ':count日',
'd' => ':count日',
'hour' => ':count時間',
'h' => ':count時間',
'minute' => ':count分',
'min' => ':count分',
'second' => '{1}数秒|]1,Inf[:count秒',
's' => ':count秒',
'ago' => ':time前',
'from_now' => ':time後',
'after' => ':time後',
'before' => ':time前',
'diff_yesterday' => '昨日',
'diff_tomorrow' => '明日',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY/MM/DD',
'LL' => 'YYYY年M月D日',
'LLL' => 'YYYY年M月D日 HH:mm',
'LLLL' => 'YYYY年M月D日 dddd HH:mm',
],
'calendar' => [
'sameDay' => '[今日] LT',
'nextDay' => '[明日] LT',
'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) {
if ($other->week !== $current->week) {
return '[来週]dddd LT';
}
return 'dddd LT';
},
'lastDay' => '[昨日] LT',
'lastWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) {
if ($other->week !== $current->week) {
return '[先週]dddd LT';
}
return 'dddd LT';
},
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'd':
case 'D':
case 'DDD':
return $number.'日';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? '午前' : '午後';
},
'months' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
'weekdays' => ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'],
'weekdays_short' => ['日', '月', '火', '水', '木', '金', '土'],
'weekdays_min' => ['日', '月', '火', '水', '木', '金', '土'],
];
src/Carbon/Lang/jv.php 0000644 00000003764 15014555553 0010572 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}setaun|]1,Inf[:count taun',
'month' => '{1}sewulan|]1,Inf[:count wulan',
'week' => '{1}sakminggu|]1,Inf[:count minggu',
'day' => '{1}sedinten|]1,Inf[:count dinten',
'hour' => '{1}setunggal jam|]1,Inf[:count jam',
'minute' => '{1}setunggal menit|]1,Inf[:count menit',
'second' => '{1}sawetawis detik|]1,Inf[:count detik',
'ago' => ':time ingkang kepengker',
'from_now' => 'wonten ing :time',
'formats' => [
'LT' => 'HH.mm',
'LTS' => 'HH.mm.ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY [pukul] HH.mm',
'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm',
],
'calendar' => [
'sameDay' => '[Dinten puniko pukul] LT',
'nextDay' => '[Mbenjang pukul] LT',
'nextWeek' => 'dddd [pukul] LT',
'lastDay' => '[Kala wingi pukul] LT',
'lastWeek' => 'dddd [kepengker pukul] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 11) {
return 'enjing';
}
if ($hour < 15) {
return 'siyang';
}
if ($hour < 19) {
return 'sonten';
}
return 'ndalu';
},
'months' => ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'],
'weekdays' => ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'],
'weekdays_short' => ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'],
'weekdays_min' => ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ka.php 0000644 00000010307 15014555553 0010535 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}წელი|]1,Inf[:count წელი',
'y' => ':count წლის',
'month' => '{1}თვე|]1,Inf[:count თვე',
'm' => ':count თვის',
'week' => ':count კვირის',
'w' => ':count კვირის',
'day' => '{1}დღე|]1,Inf[:count დღე',
'd' => ':count დღის',
'hour' => '{1}საათი|]1,Inf[:count საათი',
'h' => ':count საათის',
'minute' => '{1}წუთი|]1,Inf[:count წუთი',
'min' => ':count წუთის',
'second' => '{1}რამდენიმე წამი|]1,Inf[:count წამი',
's' => ':count წამის',
'ago' => function ($time) {
return (preg_match('/(წამი|წუთი|საათი|წელი)/', $time) ?
preg_replace('/ი$/', 'ში', $time) :
$time
).'ში';
},
'from_now' => function ($time) {
if (preg_match('/(წამი|წუთი|საათი|დღე|თვე)/', $time)) {
return preg_replace('/(ი|ე)$/', 'ის წინ', $time);
}
if (preg_match('/წელი/', $time)) {
return preg_replace('/წელი$/', 'წლის წინ', $time);
}
return preg_replace('/კვირის/', 'კვირაა', $time);
},
'after' => ':time შემდეგ',
'before' => ':time უკან',
'diff_yesterday' => 'გუშინ',
'diff_tomorrow' => 'ხვალ',
'formats' => [
'LT' => 'h:mm A',
'LTS' => 'h:mm:ss A',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY h:mm A',
'LLLL' => 'dddd, D MMMM YYYY h:mm A',
],
'calendar' => [
'sameDay' => '[დღეს] LT[-ზე]',
'nextDay' => '[ხვალ] LT[-ზე]',
'nextWeek' => '[შემდეგ] dddd LT[-ზე]',
'lastDay' => '[გუშინ] LT[-ზე]',
'lastWeek' => '[წინა] dddd LT-ზე',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
if ($number === 0) {
return $number;
}
if ($number === 1) {
return $number.'-ლი';
}
if (($number < 20) || ($number <= 100 && ($number % 20 === 0)) || ($number % 100 === 0)) {
return 'მე-'.$number;
}
return $number.'-ე';
},
'months' => ['იანვარს', 'თებერვალს', 'მარტს', 'აპრილის', 'მაისს', 'ივნისს', 'ივლისს', 'აგვისტს', 'სექტემბერს', 'ოქტომბერს', 'ნოემბერს', 'დეკემბერს'],
'months_standalone' => ['იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი'],
'months_short' => ['იან', 'თებ', 'მარ', 'აპრ', 'მაი', 'ივნ', 'ივლ', 'აგვ', 'სექ', 'ოქტ', 'ნოე', 'დეკ'],
'weekdays' => ['კვირას', 'ორშაბათს', 'სამშაბათს', 'ოთხშაბათს', 'ხუთშაბათს', 'პარასკევს', 'შაბათს'],
'weekdays_standalone' => ['კვირა', 'ორშაბათი', 'სამშაბათი', 'ოთხშაბათი', 'ხუთშაბათი', 'პარასკევი', 'შაბათი'],
'weekdays_short' => ['კვი', 'ორშ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ'],
'weekdays_min' => ['კვ', 'ორ', 'სა', 'ოთ', 'ხუ', 'პა', 'შა'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/kk.php 0000644 00000006026 15014555553 0010552 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'kk');
return [
'year' => 'бір жыл|:count жыл',
'y' => ':count жыл',
'month' => 'бір ай|:count ай',
'm' => ':count ай',
'week' => ':count апта',
'w' => ':count апта',
'day' => 'бір күн|:count күн',
'd' => ':count күн',
'hour' => 'бір сағат|:count сағат',
'h' => ':count сағат',
'minute' => 'бір минут|:count минут',
'min' => ':count минут',
'second' => 'бірнеше секунд|:count секунд',
's' => ':count секунд',
'ago' => ':time бұрын',
'from_now' => ':time ішінде',
'after' => ':time кейін',
'before' => ':time бұрын',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Бүгін сағат] LT',
'nextDay' => '[Ертең сағат] LT',
'nextWeek' => 'dddd [сағат] LT',
'lastDay' => '[Кеше сағат] LT',
'lastWeek' => '[Өткен аптаның] dddd [сағат] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
static $suffixes = [
0 => '-ші',
1 => '-ші',
2 => '-ші',
3 => '-ші',
4 => '-ші',
5 => '-ші',
6 => '-шы',
7 => '-ші',
8 => '-ші',
9 => '-шы',
10 => '-шы',
20 => '-шы',
30 => '-шы',
40 => '-шы',
50 => '-ші',
60 => '-шы',
70 => '-ші',
80 => '-ші',
90 => '-шы',
100 => '-ші',
];
return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? '');
},
'months' => ['қаңтар', 'ақпан', 'наурыз', 'сәуір', 'мамыр', 'маусым', 'шілде', 'тамыз', 'қыркүйек', 'қазан', 'қараша', 'желтоқсан'],
'months_short' => ['қаң', 'ақп', 'нау', 'сәу', 'мам', 'мау', 'шіл', 'там', 'қыр', 'қаз', 'қар', 'жел'],
'weekdays' => ['жексенбі', 'дүйсенбі', 'сейсенбі', 'сәрсенбі', 'бейсенбі', 'жұма', 'сенбі'],
'weekdays_short' => ['жек', 'дүй', 'сей', 'сәр', 'бей', 'жұм', 'сен'],
'weekdays_min' => ['жк', 'дй', 'сй', 'ср', 'бй', 'жм', 'сн'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/km.php 0000644 00000005360 15014555553 0010554 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}មួយឆ្នាំ|]1,Inf[:count ឆ្នាំ',
'y' => ':count ឆ្នាំ',
'month' => '{1}មួយខែ|]1,Inf[:count ខែ',
'm' => ':count ខែ',
'week' => ':count សប្ដាហ៍',
'w' => ':count សប្ដាហ៍',
'day' => '{1}មួយថ្ងៃ|]1,Inf[:count ថ្ងៃ',
'd' => ':count ថ្ងៃ',
'hour' => '{1}មួយម៉ោង|]1,Inf[:count ម៉ោង',
'h' => ':count ម៉ោង',
'minute' => '{1}មួយនាទី|]1,Inf[:count នាទី',
'min' => ':count នាទី',
'second' => '{1}ប៉ុន្មានវិនាទី|]1,Inf[:count វិនាទី',
's' => ':count វិនាទី',
'ago' => ':timeមុន',
'from_now' => ':timeទៀត',
'after' => 'នៅក្រោយ :time',
'before' => 'នៅមុន :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[ថ្ងៃនេះ ម៉ោង] LT',
'nextDay' => '[ស្អែក ម៉ោង] LT',
'nextWeek' => 'dddd [ម៉ោង] LT',
'lastDay' => '[ម្សិលមិញ ម៉ោង] LT',
'lastWeek' => 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
'sameElse' => 'L',
],
'ordinal' => 'ទី:number',
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ព្រឹក' : 'ល្ងាច';
},
'months' => ['មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ'],
'months_short' => ['មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ'],
'weekdays' => ['អាទិត្យ', 'ច័ន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'],
'weekdays_short' => ['អា', 'ច', 'អ', 'ព', 'ព្រ', 'សុ', 'ស'],
'weekdays_min' => ['អា', 'ច', 'អ', 'ព', 'ព្រ', 'សុ', 'ស'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/kn.php 0000644 00000005536 15014555553 0010562 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}ಒಂದು ವರ್ಷ|]1,Inf[:count ವರ್ಷ',
'month' => '{1}ಒಂದು ತಿಂಗಳು|]1,Inf[:count ತಿಂಗಳು',
'week' => '{1}ಒಂದು ವಾರ|]1,Inf[:count ವಾರಗಳು',
'day' => '{1}ಒಂದು ದಿನ|]1,Inf[:count ದಿನ',
'hour' => '{1}ಒಂದು ಗಂಟೆ|]1,Inf[:count ಗಂಟೆ',
'minute' => '{1}ಒಂದು ನಿಮಿಷ|]1,Inf[:count ನಿಮಿಷ',
'second' => '{1}ಕೆಲವು ಕ್ಷಣಗಳು|]1,Inf[:count ಸೆಕೆಂಡುಗಳು',
'ago' => ':time ಹಿಂದೆ',
'from_now' => ':time ನಂತರ',
'diff_yesterday' => 'ನಿನ್ನೆ',
'diff_tomorrow' => 'ನಾಳೆ',
'formats' => [
'LT' => 'A h:mm',
'LTS' => 'A h:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, A h:mm',
'LLLL' => 'dddd, D MMMM YYYY, A h:mm',
],
'calendar' => [
'sameDay' => '[ಇಂದು] LT',
'nextDay' => '[ನಾಳೆ] LT',
'nextWeek' => 'dddd, LT',
'lastDay' => '[ನಿನ್ನೆ] LT',
'lastWeek' => '[ಕೊನೆಯ] dddd, LT',
'sameElse' => 'L',
],
'ordinal' => ':numberನೇ',
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'ರಾತ್ರಿ';
}
if ($hour < 10) {
return 'ಬೆಳಿಗ್ಗೆ';
}
if ($hour < 17) {
return 'ಮಧ್ಯಾಹ್ನ';
}
if ($hour < 20) {
return 'ಸಂಜೆ';
}
return 'ರಾತ್ರಿ';
},
'months' => ['ಜನವರಿ', 'ಫೆಬ್ರವರಿ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂಬರ್', 'ಅಕ್ಟೋಬರ್', 'ನವೆಂಬರ್', 'ಡಿಸೆಂಬರ್'],
'months_short' => ['ಜನ', 'ಫೆಬ್ರ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂ', 'ಅಕ್ಟೋ', 'ನವೆಂ', 'ಡಿಸೆಂ'],
'weekdays' => ['ಭಾನುವಾರ', 'ಸೋಮವಾರ', 'ಮಂಗಳವಾರ', 'ಬುಧವಾರ', 'ಗುರುವಾರ', 'ಶುಕ್ರವಾರ', 'ಶನಿವಾರ'],
'weekdays_short' => ['ಭಾನು', 'ಸೋಮ', 'ಮಂಗಳ', 'ಬುಧ', 'ಗುರು', 'ಶುಕ್ರ', 'ಶನಿ'],
'weekdays_min' => ['ಭಾ', 'ಸೋ', 'ಮಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'],
];
src/Carbon/Lang/ko.php 0000644 00000004441 15014555553 0010555 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}일 년|]1,Inf[:count년',
'y' => ':count 년',
'month' => '{1}한 달|]1,Inf[:count달',
'm' => ':count 개월',
'week' => ':count 주일',
'w' => ':count 주일',
'day' => '{1}하루|]1,Inf[:count일',
'd' => ':count 일',
'hour' => '{1}한 시간|]1,Inf[:count시간',
'h' => ':count 시간',
'minute' => '{1}1분|]1,Inf[:count분',
'min' => ':count 분',
'second' => '{1}몇 초|]1,Inf[:count초',
's' => ':count 초',
'ago' => ':time 전',
'from_now' => ':time 후',
'after' => ':time 이후',
'before' => ':time 이전',
'formats' => [
'LT' => 'A h:mm',
'LTS' => 'A h:mm:ss',
'L' => 'YYYY.MM.DD.',
'LL' => 'YYYY년 MMMM D일',
'LLL' => 'YYYY년 MMMM D일 A h:mm',
'LLLL' => 'YYYY년 MMMM D일 dddd A h:mm',
],
'calendar' => [
'sameDay' => '오늘 LT',
'nextDay' => '내일 LT',
'nextWeek' => 'dddd LT',
'lastDay' => '어제 LT',
'lastWeek' => '지난주 dddd LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'd':
case 'D':
case 'DDD':
return $number.'일';
case 'M':
return $number.'월';
case 'w':
case 'W':
return $number.'주';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? '오전' : '오후';
},
'months' => ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
'months_short' => ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
'weekdays' => ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],
'weekdays_short' => ['일', '월', '화', '수', '목', '금', '토'],
'weekdays_min' => ['일', '월', '화', '수', '목', '금', '토'],
];
src/Carbon/Lang/ku.php 0000644 00000003223 15014555553 0010560 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$months = ['کانونی دووەم', 'شوبات', 'ئازار', 'نیسان', 'ئایار', 'حوزەیران', 'تەمموز', 'ئاب', 'ئەیلول', 'تشرینی یەکەم', 'تشرینی دووەم', 'کانونی یەکەم'];
$weekdays = ['دوو شەممە', 'سێ شەممە', 'چوار شەممە', 'پێنج شەممە', 'هەینی', 'شەممە', 'یەک شەممە'];
return [
'ago' => 'لەمەوبەر :time',
'from_now' => ':time لە ئێستاوە',
'after' => 'دوای :time',
'before' => 'پێش :time',
'year' => '{0}ساڵ|{1}ساڵ|{2}ساڵ|[3,10]:count ساڵ|[11,Inf]:count ساڵ',
'month' => '{0}مانگ|{1}مانگ|{2}مانگ|[3,10]:count مانگ|[11,Inf]:count مانگ',
'week' => '{0}هەفتە|{1}هەفتە|{2}هەفتە|[3,10]:count هەفتە|[11,Inf]:count هەفتە',
'day' => '{0}ڕۆژ|{1}ڕۆژ|{2}ڕۆژ|[3,10]:count ڕۆژ|[11,Inf]:count ڕۆژ',
'hour' => '{0}کاژێر|{1}کاژێر|{2}کاژێر|[3,10]:count کاژێر|[11,Inf]:count کاژێر',
'minute' => '{0}خولەک|{1}خولەک|{2}خولەک|[3,10]:count خولەک|[11,Inf]:count خولەک',
'second' => '{0}چرکە|{1}چرکە|{2}چرکە|[3,10]:count چرکە|[11,Inf]:count چرکە',
'months' => $months,
'months_standalone' => $months,
'months_short' => $months,
'weekdays' => $weekdays,
'weekdays_short' => $weekdays,
'weekdays_min' => $weekdays,
];
src/Carbon/Lang/ky.php 0000644 00000005412 15014555553 0010566 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'ky');
return [
'year' => 'бир жыл|:count жыл',
'month' => 'бир ай|:count ай',
'week' => 'бир жума|:count жума',
'day' => 'бир күн|:count күн',
'hour' => 'бир саат|:count саат',
'minute' => 'бир мүнөт|:count мүнөт',
'second' => 'бирнече секунд|:count секунд',
'ago' => ':time мурун',
'from_now' => ':time ичинде',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Бүгүн саат] LT',
'nextDay' => '[Эртең саат] LT',
'nextWeek' => 'dddd [саат] LT',
'lastDay' => '[Кече саат] LT',
'lastWeek' => '[Өткен аптанын] dddd [күнү] [саат] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
static $suffixes = [
0 => '-чү',
1 => '-чи',
2 => '-чи',
3 => '-чү',
4 => '-чү',
5 => '-чи',
6 => '-чы',
7 => '-чи',
8 => '-чи',
9 => '-чу',
10 => '-чу',
20 => '-чы',
30 => '-чу',
40 => '-чы',
50 => '-чү',
60 => '-чы',
70 => '-чи',
80 => '-чи',
90 => '-чу',
100 => '-чү',
];
return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? '');
},
'months' => ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'],
'months_short' => ['янв', 'фев', 'март', 'апр', 'май', 'июнь', 'июль', 'авг', 'сен', 'окт', 'ноя', 'дек'],
'weekdays' => ['Жекшемби', 'Дүйшөмбү', 'Шейшемби', 'Шаршемби', 'Бейшемби', 'Жума', 'Ишемби'],
'weekdays_short' => ['Жек', 'Дүй', 'Шей', 'Шар', 'Бей', 'Жум', 'Ише'],
'weekdays_min' => ['Жк', 'Дй', 'Шй', 'Шр', 'Бй', 'Жм', 'Иш'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/lb.php 0000644 00000004234 15014555553 0010541 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count Joer',
'y' => ':countJ',
'month' => ':count Mount|:count Méint',
'm' => ':countMo',
'week' => ':count Woch|:count Wochen',
'w' => ':countWo|:countWo',
'day' => ':count Dag|:count Deeg',
'd' => ':countD',
'hour' => ':count Stonn|:count Stonnen',
'h' => ':countSto',
'minute' => ':count Minutt|:count Minutten',
'min' => ':countM',
'second' => ':count Sekonnen',
's' => ':countSek',
'formats' => [
'LT' => 'H:mm [Auer]',
'LTS' => 'H:mm:ss [Auer]',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY H:mm [Auer]',
'LLLL' => 'dddd, D. MMMM YYYY H:mm [Auer]',
],
'calendar' => [
'sameDay' => '[Haut um] LT',
'nextDay' => '[Muer um] LT',
'nextWeek' => 'dddd [um] LT',
'lastDay' => '[Gëschter um] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
// Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
switch ($date->dayOfWeek) {
case 2:
case 4:
return '[Leschten] dddd [um] LT';
default:
return '[Leschte] dddd [um] LT';
}
},
'sameElse' => 'L',
],
'months' => ['Januar', 'Februar', 'Mäerz', 'Abrëll', 'Mee', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
'months_short' => ['Jan.', 'Febr.', 'Mrz.', 'Abr.', 'Mee', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'],
'weekdays' => ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'],
'weekdays_short' => ['So.', 'Mé.', 'Dë.', 'Më.', 'Do.', 'Fr.', 'Sa.'],
'weekdays_min' => ['So', 'Mé', 'Dë', 'Më', 'Do', 'Fr', 'Sa'],
'ordinal' => ':number.',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/lo.php 0000644 00000005003 15014555553 0010551 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'lo');
return [
'year' => ':count ປີ',
'month' => ':count ເດືອນ',
'week' => ':count ອາທິດ',
'day' => ':count ມື້',
'hour' => ':count ຊົ່ວໂມງ',
'minute' => ':count ນາທີ',
'second' => 'ບໍ່ເທົ່າໃດວິນາທີ|:count ວິນາທີ',
'ago' => ':timeຜ່ານມາ',
'from_now' => 'ອີກ :time',
'diff_yesterday' => 'ມື້ວານນີ້ເວລາ',
'diff_tomorrow' => 'ມື້ອື່ນເວລາ',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'ວັນdddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[ມື້ນີ້ເວລາ] LT',
'nextDay' => '[ມື້ອື່ນເວລາ] LT',
'nextWeek' => '[ວັນ]dddd[ໜ້າເວລາ] LT',
'lastDay' => '[ມື້ວານນີ້ເວລາ] LT',
'lastWeek' => '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
'sameElse' => 'L',
],
'ordinal' => 'ທີ່:number',
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ຕອນເຊົ້າ' : 'ຕອນແລງ';
},
'months' => ['ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ'],
'months_short' => ['ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ'],
'weekdays' => ['ອາທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ'],
'weekdays_short' => ['ທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ'],
'weekdays_min' => ['ທ', 'ຈ', 'ອຄ', 'ພ', 'ພຫ', 'ສກ', 'ສ'],
];
src/Carbon/Lang/lt.php 0000644 00000003420 15014555553 0010557 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count metus|:count metus|:count metų',
'y' => ':count metus|:count metus|:count metų',
'month' => ':count mėnesį|:count mėnesius|:count mėnesių',
'm' => ':count mėnesį|:count mėnesius|:count mėnesių',
'week' => ':count savaitę|:count savaites|:count savaičių',
'w' => ':count savaitę|:count savaites|:count savaičių',
'day' => ':count dieną|:count dienas|:count dienų',
'd' => ':count dieną|:count dienas|:count dienų',
'hour' => ':count valandą|:count valandas|:count valandų',
'h' => ':count valandą|:count valandas|:count valandų',
'minute' => ':count minutę|:count minutes|:count minučių',
'min' => ':count minutę|:count minutes|:count minučių',
'second' => ':count sekundę|:count sekundes|:count sekundžių',
's' => ':count sekundę|:count sekundes|:count sekundžių',
'second_from_now' => ':count sekundės|:count sekundžių|:count sekundžių',
'minute_from_now' => ':count minutės|:count minučių|:count minučių',
'hour_from_now' => ':count valandos|:count valandų|:count valandų',
'day_from_now' => ':count dienos|:count dienų|:count dienų',
'week_from_now' => ':count savaitės|:count savaičių|:count savaičių',
'month_from_now' => ':count mėnesio|:count mėnesių|:count mėnesių',
'year_from_now' => ':count metų',
'ago' => 'prieš :time',
'from_now' => 'už :time',
'after' => 'po :time',
'before' => ':time nuo dabar',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/lv.php 0000644 00000004161 15014555553 0010564 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '0 gadiem|:count gada|:count gadiem',
'y' => '0 gadiem|:count gada|:count gadiem',
'month' => '0 mēnešiem|:count mēneša|:count mēnešiem',
'm' => '0 mēnešiem|:count mēneša|:count mēnešiem',
'week' => '0 nedēļām|:count nedēļas|:count nedēļām',
'w' => '0 nedēļām|:count nedēļas|:count nedēļām',
'day' => '0 dienām|:count dienas|:count dienām',
'd' => '0 dienām|:count dienas|:count dienām',
'hour' => '0 stundām|:count stundas|:count stundām',
'h' => '0 stundām|:count stundas|:count stundām',
'minute' => '0 minūtēm|:count minūtes|:count minūtēm',
'min' => '0 minūtēm|:count minūtes|:count minūtēm',
'second' => '0 sekundēm|:count sekundes|:count sekundēm',
's' => '0 sekundēm|:count sekundes|:count sekundēm',
'ago' => 'pirms :time',
'from_now' => 'pēc :time',
'after' => ':time vēlāk',
'before' => ':time pirms',
'year_after' => '0 gadus|:count gadu|:count gadus',
'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus',
'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas',
'day_after' => '0 dienas|:count dienu|:count dienas',
'hour_after' => '0 stundas|:count stundu|:count stundas',
'minute_after' => '0 minūtes|:count minūti|:count minūtes',
'second_after' => '0 sekundes|:count sekundi|:count sekundes',
'year_before' => '0 gadus|:count gadu|:count gadus',
'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus',
'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas',
'day_before' => '0 dienas|:count dienu|:count dienas',
'hour_before' => '0 stundas|:count stundu|:count stundas',
'minute_before' => '0 minūtes|:count minūti|:count minūtes',
'second_before' => '0 sekundes|:count sekundi|:count sekundes',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/me.php 0000644 00000006524 15014555553 0010551 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return \Symfony\Component\Translation\PluralizationRules::get($number, 'sr');
}, 'me');
return [
'year' => ':count godina|:count godine|:count godina',
'y' => ':count godina|:count godine|:count godina',
'month' => ':count mjesec|:count mjeseca|:count mjeseci',
'm' => ':count mjesec|:count mjeseca|:count mjeseci',
'week' => ':count nedjelja|:count nedjelje|:count nedjelja',
'w' => ':count nedjelja|:count nedjelje|:count nedjelja',
'day' => ':count dan|:count dana|:count dana',
'd' => ':count dan|:count dana|:count dana',
'hour' => ':count sat|:count sata|:count sati',
'h' => ':count sat|:count sata|:count sati',
'minute' => ':count minut|:count minuta|:count minuta',
'min' => ':count minut|:count minuta|:count minuta',
'second' => ':count sekund|:count sekunda|:count sekundi',
's' => ':count sekund|:count sekunda|:count sekundi',
'ago' => 'prije :time',
'from_now' => 'za :time',
'diff_yesterday' => 'juče',
'diff_tomorrow' => 'sjutra',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY H:mm',
'LLLL' => 'dddd, D. MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[danas u] LT',
'nextDay' => '[sjutra u] LT',
'nextWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[u nedjelju u] LT';
case 3:
return '[u srijedu u] LT';
case 6:
return '[u subotu u] LT';
default:
return '[u] dddd [u] LT';
}
},
'lastDay' => '[juče u] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[prošle nedjelje u] LT';
case 1:
return '[prošle nedjelje u] LT';
case 2:
return '[prošlog utorka u] LT';
case 3:
return '[prošle srijede u] LT';
case 4:
return '[prošlog četvrtka u] LT';
case 5:
return '[prošlog petka u] LT';
default:
return '[prošle subote u] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],
'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],
'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'],
'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'],
'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/mi.php 0000644 00000003612 15014555553 0010550 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'mi');
return [
'year' => 'he tau|:count tau',
'month' => 'he marama|:count marama',
'week' => 'he wiki|:count wiki',
'day' => 'he ra|:count ra',
'hour' => 'te haora|:count haora',
'minute' => 'he meneti|:count meneti',
'second' => 'te hēkona ruarua|:count hēkona',
'ago' => ':time i mua',
'from_now' => 'i roto i :time',
'diff_yesterday' => 'inanahi',
'diff_tomorrow' => 'apopo',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY [i] HH:mm',
'LLLL' => 'dddd, D MMMM YYYY [i] HH:mm',
],
'calendar' => [
'sameDay' => '[i teie mahana, i] LT',
'nextDay' => '[apopo i] LT',
'nextWeek' => 'dddd [i] LT',
'lastDay' => '[inanahi i] LT',
'lastWeek' => 'dddd [whakamutunga i] LT',
'sameElse' => 'L',
],
'ordinal' => ':numberº',
'months' => ['Kohi-tāte', 'Hui-tanguru', 'Poutū-te-rangi', 'Paenga-whāwhā', 'Haratua', 'Pipiri', 'Hōngoingoi', 'Here-turi-kōkā', 'Mahuru', 'Whiringa-ā-nuku', 'Whiringa-ā-rangi', 'Hakihea'],
'months_short' => ['Kohi', 'Hui', 'Pou', 'Pae', 'Hara', 'Pipi', 'Hōngoi', 'Here', 'Mahu', 'Whi-nu', 'Whi-ra', 'Haki'],
'weekdays' => ['Rātapu', 'Mane', 'Tūrei', 'Wenerei', 'Tāite', 'Paraire', 'Hātarei'],
'weekdays_short' => ['Ta', 'Ma', 'Tū', 'We', 'Tāi', 'Pa', 'Hā'],
'weekdays_min' => ['Ta', 'Ma', 'Tū', 'We', 'Tāi', 'Pa', 'Hā'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/mk.php 0000644 00000005610 15014555553 0010552 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'година|:count години',
'month' => 'месец|:count месеци',
'week' => ':count седмица|:count седмици',
'day' => 'ден|:count дена',
'hour' => 'час|:count часа',
'minute' => 'минута|:count минути',
'second' => 'неколку секунди|:count секунди',
'ago' => 'пред :time',
'from_now' => 'после :time',
'after' => 'по :time',
'before' => 'пред :time',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'D.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY H:mm',
'LLLL' => 'dddd, D MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[Денес во] LT',
'nextDay' => '[Утре во] LT',
'nextWeek' => '[Во] dddd [во] LT',
'lastDay' => '[Вчера во] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
case 3:
case 6:
return '[Изминатата] dddd [во] LT';
default:
return '[Изминатиот] dddd [во] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => function ($number) {
$lastDigit = $number % 10;
$last2Digits = $number % 100;
if ($number === 0) {
return $number.'-ев';
}
if ($last2Digits === 0) {
return $number.'-ен';
}
if ($last2Digits > 10 && $last2Digits < 20) {
return $number.'-ти';
}
if ($lastDigit === 1) {
return $number.'-ви';
}
if ($lastDigit === 2) {
return $number.'-ри';
}
if ($lastDigit === 7 || $lastDigit === 8) {
return $number.'-ми';
}
return $number.'-ти';
},
'months' => ['јануари', 'февруари', 'март', 'април', 'мај', 'јуни', 'јули', 'август', 'септември', 'октомври', 'ноември', 'декември'],
'months_short' => ['јан', 'фев', 'мар', 'апр', 'мај', 'јун', 'јул', 'авг', 'сеп', 'окт', 'ное', 'дек'],
'weekdays' => ['недела', 'понеделник', 'вторник', 'среда', 'четврток', 'петок', 'сабота'],
'weekdays_short' => ['нед', 'пон', 'вто', 'сре', 'чет', 'пет', 'саб'],
'weekdays_min' => ['нe', 'пo', 'вт', 'ср', 'че', 'пе', 'сa'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ml.php 0000644 00000005526 15014555553 0010561 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'ഒരു വർഷം|:count വർഷം',
'month' => 'ഒരു മാസം|:count മാസം',
'week' => 'ഒരാഴ്ച|:count ആഴ്ച',
'day' => 'ഒരു ദിവസം|:count ദിവസം',
'hour' => 'ഒരു മണിക്കൂർ|:count മണിക്കൂർ',
'minute' => 'ഒരു മിനിറ്റ്|:count മിനിറ്റ്',
'second' => 'അൽപ നിമിഷങ്ങൾ|:count സെക്കൻഡ്',
'ago' => ':time മുൻപ്',
'from_now' => ':time കഴിഞ്ഞ്',
'diff_yesterday' => 'ഇന്നലെ',
'diff_tomorrow' => 'നാളെ',
'formats' => [
'LT' => 'A h:mm -നു',
'LTS' => 'A h:mm:ss -നു',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, A h:mm -നു',
'LLLL' => 'dddd, D MMMM YYYY, A h:mm -നു',
],
'calendar' => [
'sameDay' => '[ഇന്ന്] LT',
'nextDay' => '[നാളെ] LT',
'nextWeek' => 'dddd, LT',
'lastDay' => '[ഇന്നലെ] LT',
'lastWeek' => '[കഴിഞ്ഞ] dddd, LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'രാത്രി';
}
if ($hour < 12) {
return 'രാവിലെ';
}
if ($hour < 17) {
return 'ഉച്ച കഴിഞ്ഞ്';
}
if ($hour < 20) {
return 'വൈകുന്നേരം';
}
return 'രാത്രി';
},
'months' => ['ജനുവരി', 'ഫെബ്രുവരി', 'മാർച്ച്', 'ഏപ്രിൽ', 'മേയ്', 'ജൂൺ', 'ജൂലൈ', 'ഓഗസ്റ്റ്', 'സെപ്റ്റംബർ', 'ഒക്ടോബർ', 'നവംബർ', 'ഡിസംബർ'],
'months_short' => ['ജനു.', 'ഫെബ്രു.', 'മാർ.', 'ഏപ്രി.', 'മേയ്', 'ജൂൺ', 'ജൂലൈ.', 'ഓഗ.', 'സെപ്റ്റ.', 'ഒക്ടോ.', 'നവം.', 'ഡിസം.'],
'weekdays' => ['ഞായറാഴ്ച', 'തിങ്കളാഴ്ച', 'ചൊവ്വാഴ്ച', 'ബുധനാഴ്ച', 'വ്യാഴാഴ്ച', 'വെള്ളിയാഴ്ച', 'ശനിയാഴ്ച'],
'weekdays_short' => ['ഞായർ', 'തിങ്കൾ', 'ചൊവ്വ', 'ബുധൻ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
'weekdays_min' => ['ഞാ', 'തി', 'ചൊ', 'ബു', 'വ്യാ', 'വെ', 'ശ'],
];
src/Carbon/Lang/mn.php 0000644 00000004277 15014555553 0010565 0 ustar 00
*
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @translator Batmandakh Erdenebileg
*/
return [
'year' => ':count жил',
'y' => ':count жил',
'month' => ':count сар',
'm' => ':count сар',
'week' => ':count долоо хоног',
'w' => ':count долоо хоног',
'day' => ':count өдөр',
'd' => ':count өдөр',
'hour' => ':count цаг',
'h' => ':countц',
'minute' => ':count минут',
'min' => ':countм',
'second' => ':count секунд',
's' => ':countс',
'ago' => ':timeн өмнө',
'year_ago' => ':count жилий',
'month_ago' => ':count сары',
'day_ago' => ':count хоногий',
'hour_ago' => ':count цагий',
'minute_ago' => ':count минуты',
'second_ago' => ':count секунды',
'from_now' => 'одоогоос :time',
'year_from_now' => ':count жилийн дараа',
'month_from_now' => ':count сарын дараа',
'day_from_now' => ':count хоногийн дараа',
'hour_from_now' => ':count цагийн дараа',
'minute_from_now' => ':count минутын дараа',
'second_from_now' => ':count секундын дараа',
// Does it required to make translation for before, after as follows? hmm, I think we've made it with ago and from now keywords already. Anyway, I've included it just in case of undesired action...
'after' => ':timeн дараа',
'year_after' => ':count жилий',
'month_after' => ':count сары',
'day_after' => ':count хоногий',
'hour_after' => ':count цагий',
'minute_after' => ':count минуты',
'second_after' => ':count секунды',
'before' => ':timeн өмнө',
'year_before' => ':count жилий',
'month_before' => ':count сары',
'day_before' => ':count хоногий',
'hour_before' => ':count цагий',
'minute_before' => ':count минуты',
'second_before' => ':count секунды',
];
src/Carbon/Lang/mr.php 0000644 00000005563 15014555553 0010570 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count वर्ष',
'y' => ':count वर्ष',
'month' => ':count महिना|:count महिने',
'm' => ':count महिना|:count महिने',
'week' => ':count आठवडा|:count आठवडे',
'w' => ':count आठवडा|:count आठवडे',
'day' => ':count दिवस',
'd' => ':count दिवस',
'hour' => ':count तास',
'h' => ':count तास',
'minute' => ':count मिनिटे',
'min' => ':count मिनिटे',
'second' => ':count सेकंद',
's' => ':count सेकंद',
'ago' => ':timeपूर्वी',
'from_now' => ':timeमध्ये',
'diff_yesterday' => 'काल',
'diff_tomorrow' => 'उद्या',
'formats' => [
'LT' => 'A h:mm वाजता',
'LTS' => 'A h:mm:ss वाजता',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, A h:mm वाजता',
'LLLL' => 'dddd, D MMMM YYYY, A h:mm वाजता',
],
'calendar' => [
'sameDay' => '[आज] LT',
'nextDay' => '[उद्या] LT',
'nextWeek' => 'dddd, LT',
'lastDay' => '[काल] LT',
'lastWeek' => '[मागील] dddd, LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'रात्री';
}
if ($hour < 10) {
return 'सकाळी';
}
if ($hour < 17) {
return 'दुपारी';
}
if ($hour < 20) {
return 'सायंकाळी';
}
return 'रात्री';
},
'months' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ऑगस्ट', 'सप्टेंबर', 'ऑक्टोबर', 'नोव्हेंबर', 'डिसेंबर'],
'months_short' => ['जाने.', 'फेब्रु.', 'मार्च.', 'एप्रि.', 'मे.', 'जून.', 'जुलै.', 'ऑग.', 'सप्टें.', 'ऑक्टो.', 'नोव्हें.', 'डिसें.'],
'weekdays' => ['रविवार', 'सोमवार', 'मंगळवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'],
'weekdays_short' => ['रवि', 'सोम', 'मंगळ', 'बुध', 'गुरू', 'शुक्र', 'शनि'],
'weekdays_min' => ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'],
];
src/Carbon/Lang/ms.php 0000644 00000004272 15014555553 0010565 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}setahun|]1,Inf[:count tahun',
'y' => ':count tahun',
'month' => '{1}sebulan|]1,Inf[:count bulan',
'm' => ':count bulan',
'week' => '{1}seminggu|]1,Inf[:count minggu',
'w' => ':count minggu',
'day' => '{1}sehari|]1,Inf[:count hari',
'd' => ':count hari',
'hour' => '{1}sejam|]1,Inf[:count jam',
'h' => ':count jam',
'minute' => '{1}seminit|]1,Inf[:count minit',
'min' => ':count minit',
'second' => '{1}beberapa saat|]1,Inf[:count saat',
's' => ':count saat',
'ago' => ':time yang lepas',
'from_now' => 'dalam :time',
'after' => ':time selepas',
'before' => ':time sebelum',
'formats' => [
'LT' => 'HH.mm',
'LTS' => 'HH.mm.ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY [pukul] HH.mm',
'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm',
],
'calendar' => [
'sameDay' => '[Hari ini pukul] LT',
'nextDay' => '[Esok pukul] LT',
'nextWeek' => 'dddd [pukul] LT',
'lastDay' => '[Kelmarin pukul] LT',
'lastWeek' => 'dddd [lepas pukul] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 11) {
return 'pagi';
}
if ($hour < 15) {
return 'tengahari';
}
if ($hour < 19) {
return 'petang';
}
return 'malam';
},
'months' => ['Januari', 'Februari', 'Mac', 'April', 'Mei', 'Jun', 'Julai', 'Ogos', 'September', 'Oktober', 'November', 'Disember'],
'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ogs', 'Sep', 'Okt', 'Nov', 'Dis'],
'weekdays' => ['Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu'],
'weekdays_short' => ['Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab'],
'weekdays_min' => ['Ah', 'Is', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ms_MY.php 0000644 00000003666 15014555553 0011200 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}setahun|]1,Inf[:count tahun',
'month' => '{1}sebulan|]1,Inf[:count bulan',
'week' => '{1}seminggu|:count minggu',
'day' => '{1}sehari|]1,Inf[:count hari',
'hour' => '{1}sejam|]1,Inf[:count jam',
'minute' => '{1}seminit|]1,Inf[:count minit',
'second' => '{1}beberapa saat|]1,Inf[:count saat',
'ago' => ':time yang lepas',
'from_now' => 'dalam :time',
'formats' => [
'LT' => 'HH.mm',
'LTS' => 'HH.mm.ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY [pukul] HH.mm',
'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm',
],
'calendar' => [
'sameDay' => '[Hari ini pukul] LT',
'nextDay' => '[Esok pukul] LT',
'nextWeek' => 'dddd [pukul] LT',
'lastDay' => '[Kelmarin pukul] LT',
'lastWeek' => 'dddd [lepas pukul] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 11) {
return 'pagi';
}
if ($hour < 15) {
return 'tengahari';
}
if ($hour < 19) {
return 'petang';
}
return 'malam';
},
'months' => ['Januari', 'Februari', 'Mac', 'April', 'Mei', 'Jun', 'Julai', 'Ogos', 'September', 'Oktober', 'November', 'Disember'],
'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ogs', 'Sep', 'Okt', 'Nov', 'Dis'],
'weekdays' => ['Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu'],
'weekdays_short' => ['Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab'],
'weekdays_min' => ['Ah', 'Is', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/mt.php 0000644 00000003216 15014555553 0010563 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'sena|:count sni',
'month' => 'xahar|:count xhur',
'week' => 'gimgħa|:count ġimgħat',
'day' => 'ġurnata|:count ġranet',
'hour' => 'siegħa|:count siegħat',
'minute' => 'minuta|:count minuti',
'second' => 'ftit sekondi|:count sekondi',
'ago' => ':time ilu',
'from_now' => 'f’ :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Illum fil-]LT',
'nextDay' => '[Għada fil-]LT',
'nextWeek' => 'dddd [fil-]LT',
'lastDay' => '[Il-bieraħ fil-]LT',
'lastWeek' => 'dddd [li għadda] [fil-]LT',
'sameElse' => 'L',
],
'ordinal' => ':numberº',
'months' => ['Jannar', 'Frar', 'Marzu', 'April', 'Mejju', 'Ġunju', 'Lulju', 'Awwissu', 'Settembru', 'Ottubru', 'Novembru', 'Diċembru'],
'months_short' => ['Jan', 'Fra', 'Mar', 'Apr', 'Mej', 'Ġun', 'Lul', 'Aww', 'Set', 'Ott', 'Nov', 'Diċ'],
'weekdays' => ['Il-Ħadd', 'It-Tnejn', 'It-Tlieta', 'L-Erbgħa', 'Il-Ħamis', 'Il-Ġimgħa', 'Is-Sibt'],
'weekdays_short' => ['Ħad', 'Tne', 'Tli', 'Erb', 'Ħam', 'Ġim', 'Sib'],
'weekdays_min' => ['Ħa', 'Tn', 'Tl', 'Er', 'Ħa', 'Ġi', 'Si'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/my.php 0000644 00000005773 15014555553 0010602 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'my');
return [
'year' => 'တစ်နှစ်|:count နှစ်',
'y' => ':count နှစ်',
'month' => 'တစ်လ|:count လ',
'm' => ':count လ',
'week' => ':count ပတ်',
'w' => ':count ပတ်',
'day' => 'တစ်ရက်|:count ရက်',
'd' => ':count ရက်',
'hour' => 'တစ်နာရီ|:count နာရီ',
'h' => ':count နာရီ',
'minute' => 'တစ်မိနစ်|:count မိနစ်',
'min' => ':count မိနစ်',
'second' => 'စက္ကန်.အနည်းငယ်|:count စက္ကန့်',
's' => ':count စက္ကန့်',
'ago' => 'လွန်ခဲ့သော :time က',
'from_now' => 'လာမည့် :time မှာ',
'after' => ':time ကြာပြီးနောက်',
'before' => ':time မတိုင်ခင်',
'diff_now' => 'အခုလေးတင်',
'diff_yesterday' => 'မနေ့က',
'diff_tomorrow' => 'မနက်ဖြန်',
'diff_before_yesterday' => 'တမြန်နေ့က',
'diff_after_tomorrow' => 'တဘက်ခါ',
'period_recurrences' => ':count ကြိမ်',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[ယနေ.] LT [မှာ]',
'nextDay' => '[မနက်ဖြန်] LT [မှာ]',
'nextWeek' => 'dddd LT [မှာ]',
'lastDay' => '[မနေ.က] LT [မှာ]',
'lastWeek' => '[ပြီးခဲ့သော] dddd LT [မှာ]',
'sameElse' => 'L',
],
'months' => ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'],
'months_short' => ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'],
'weekdays' => ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'],
'weekdays_short' => ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'],
'weekdays_min' => ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/nb.php 0000644 00000003224 15014555553 0010541 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'ett år|:count år',
'month' => 'en måned|:count måneder',
'week' => ':count uke|:count uker',
'day' => 'en dag|:count dager',
'hour' => 'en time|:count timer',
'minute' => 'ett minutt|:count minutter',
'second' => 'noen sekunder|:count sekunder',
'ago' => ':time siden',
'from_now' => 'om :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY [kl.] HH:mm',
'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm',
],
'calendar' => [
'sameDay' => '[i dag kl.] LT',
'nextDay' => '[i morgen kl.] LT',
'nextWeek' => 'dddd [kl.] LT',
'lastDay' => '[i går kl.] LT',
'lastWeek' => '[forrige] dddd [kl.] LT',
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'],
'months_short' => ['jan.', 'feb.', 'mars', 'april', 'mai', 'juni', 'juli', 'aug.', 'sep.', 'okt.', 'nov.', 'des.'],
'weekdays' => ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'],
'weekdays_short' => ['sø.', 'ma.', 'ti.', 'on.', 'to.', 'fr.', 'lø.'],
'weekdays_min' => ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/ne.php 0000644 00000005722 15014555553 0010551 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'एक बर्ष|:count बर्ष',
'y' => ':count वर्ष',
'month' => 'एक महिना|:count महिना',
'm' => ':count महिना',
'week' => ':count हप्ता',
'w' => ':count हप्ता',
'day' => 'एक दिन|:count दिन',
'd' => ':count दिन',
'hour' => 'एक घण्टा|:count घण्टा',
'h' => ':count घण्टा',
'minute' => 'एक मिनेट|:count मिनेट',
'min' => ':count मिनेट',
'second' => 'केही क्षण|:count सेकेण्ड',
's' => ':count सेकेण्ड',
'ago' => ':time अगाडि',
'from_now' => ':timeमा',
'after' => ':time पछि',
'before' => ':time अघि',
'diff_yesterday' => 'हिजो',
'diff_tomorrow' => 'भोलि',
'formats' => [
'LT' => 'Aको h:mm बजे',
'LTS' => 'Aको h:mm:ss बजे',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, Aको h:mm बजे',
'LLLL' => 'dddd, D MMMM YYYY, Aको h:mm बजे',
],
'calendar' => [
'sameDay' => '[आज] LT',
'nextDay' => '[भोलि] LT',
'nextWeek' => '[आउँदो] dddd[,] LT',
'lastDay' => '[हिजो] LT',
'lastWeek' => '[गएको] dddd[,] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 3) {
return 'राति';
}
if ($hour < 12) {
return 'बिहान';
}
if ($hour < 16) {
return 'दिउँसो';
}
if ($hour < 20) {
return 'साँझ';
}
return 'राति';
},
'months' => ['जनवरी', 'फेब्रुवरी', 'मार्च', 'अप्रिल', 'मई', 'जुन', 'जुलाई', 'अगष्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'],
'months_short' => ['जन.', 'फेब्रु.', 'मार्च', 'अप्रि.', 'मई', 'जुन', 'जुलाई.', 'अग.', 'सेप्ट.', 'अक्टो.', 'नोभे.', 'डिसे.'],
'weekdays' => ['आइतबार', 'सोमबार', 'मङ्गलबार', 'बुधबार', 'बिहिबार', 'शुक्रबार', 'शनिबार'],
'weekdays_short' => ['आइत.', 'सोम.', 'मङ्गल.', 'बुध.', 'बिहि.', 'शुक्र.', 'शनि.'],
'weekdays_min' => ['आ.', 'सो.', 'मं.', 'बु.', 'बि.', 'शु.', 'श.'],
];
src/Carbon/Lang/nl.php 0000644 00000004250 15014555553 0010553 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'één jaar|:count jaar',
'y' => ':countj',
'month' => 'één maand|:count maanden',
'm' => ':countma',
'week' => ':count week|:count weken',
'w' => ':countw',
'day' => 'één dag|:count dagen',
'd' => ':countd',
'hour' => 'één uur|:count uur',
'h' => ':countu',
'minute' => 'één minuut|:count minuten',
'min' => ':countmi',
'second' => 'een paar seconden|:count seconden',
's' => ':counts',
'ago' => ':time geleden',
'from_now' => 'over :time',
'after' => ':time later',
'before' => ':time eerder',
'diff_now' => 'nu',
'diff_yesterday' => 'gisteren',
'diff_tomorrow' => 'morgen',
'diff_after_tomorrow' => 'overmorgen',
'diff_before_yesterday' => 'eergisteren',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD-MM-YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[vandaag om] LT',
'nextDay' => '[morgen om] LT',
'nextWeek' => 'dddd [om] LT',
'lastDay' => '[gisteren om] LT',
'lastWeek' => '[afgelopen] dddd [om] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number) {
return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de');
},
'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
'mmm_suffix' => '.',
'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
'weekdays_short' => ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'],
'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/nl_BE.php 0000644 00000004261 15014555553 0011123 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'één jaar|:count jaar',
'y' => ':countj',
'month' => 'één maand|:count maanden',
'm' => ':countma',
'week' => ':count week|:count weken',
'w' => ':countw',
'day' => 'één dag|:count dagen',
'd' => ':countd',
'hour' => 'één uur|:count uur',
'h' => ':countu',
'minute' => 'één minuut|:count minuten',
'min' => ':countmi',
'second' => 'een paar seconden|:count seconden',
's' => ':counts',
'ago' => ':time geleden',
'from_now' => 'over :time',
'after' => ':time later',
'before' => ':time eerder',
'diff_now' => 'nu',
'diff_yesterday' => 'gisteren',
'diff_tomorrow' => 'morgen',
'diff_after_tomorrow' => 'overmorgen',
'diff_before_yesterday' => 'eergisteren',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[vandaag om] LT',
'nextDay' => '[morgen om] LT',
'nextWeek' => 'dddd [om] LT',
'lastDay' => '[gisteren om] LT',
'lastWeek' => '[afgelopen] dddd [om] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de');
},
'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
'mmm_suffix' => '.',
'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
'weekdays_short' => ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'],
'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/nn.php 0000644 00000003227 15014555553 0010560 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'eit år|:count år',
'month' => 'ein månad|:count månader',
'week' => ':count uke|:count uker',
'day' => 'ein dag|:count dagar',
'hour' => 'ein time|:count timar',
'minute' => 'eit minutt|:count minutt',
'second' => 'nokre sekund|:count sekund',
'ago' => ':time sidan',
'from_now' => 'om :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY [kl.] H:mm',
'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm',
],
'calendar' => [
'sameDay' => '[I dag klokka] LT',
'nextDay' => '[I morgon klokka] LT',
'nextWeek' => 'dddd [klokka] LT',
'lastDay' => '[I går klokka] LT',
'lastWeek' => '[Føregåande] dddd [klokka] LT',
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'],
'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'],
'weekdays' => ['sundag', 'måndag', 'tysdag', 'onsdag', 'torsdag', 'fredag', 'laurdag'],
'weekdays_short' => ['sun', 'mån', 'tys', 'ons', 'tor', 'fre', 'lau'],
'weekdays_min' => ['su', 'må', 'ty', 'on', 'to', 'fr', 'lø'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/no.php 0000644 00000002171 15014555553 0010556 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count år|:count år',
'y' => ':count år|:count år',
'month' => ':count måned|:count måneder',
'm' => ':count måned|:count måneder',
'week' => ':count uke|:count uker',
'w' => ':count uke|:count uker',
'day' => ':count dag|:count dager',
'd' => ':count dag|:count dager',
'hour' => ':count time|:count timer',
'h' => ':count time|:count timer',
'minute' => ':count minutt|:count minutter',
'min' => ':count minutt|:count minutter',
'second' => ':count sekund|:count sekunder',
's' => ':count sekund|:count sekunder',
'ago' => ':time siden',
'from_now' => 'om :time',
'after' => ':time etter',
'before' => ':time før',
'diff_now' => 'akkurat nå',
'diff_yesterday' => 'i går',
'diff_tomorrow' => 'i morgen',
'diff_before_yesterday' => 'i forgårs',
'diff_after_tomorrow' => 'i overmorgen',
];
src/Carbon/Lang/oc.php 0000644 00000002643 15014555553 0010547 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number == 1 ? 0 : 1;
}, 'oc');
return [
'year' => ':count an|:count ans',
'y' => ':count an|:count ans',
'month' => ':count mes|:count meses',
'm' => ':count mes|:count meses',
'week' => ':count setmana|:count setmanas',
'w' => ':count setmana|:count setmanas',
'day' => ':count jorn|:count jorns',
'd' => ':count jorn|:count jorns',
'hour' => ':count ora|:count oras',
'h' => ':count ora|:count oras',
'minute' => ':count minuta|:count minutas',
'min' => ':count minuta|:count minutas',
'second' => ':count segonda|:count segondas',
's' => ':count segonda|:count segondas',
'ago' => 'fa :time',
'from_now' => 'd\'aquí :time',
'after' => ':time aprèp',
'before' => ':time abans',
'diff_now' => 'ara meteis',
'diff_yesterday' => 'ièr',
'diff_tomorrow' => 'deman',
'diff_before_yesterday' => 'ièr delà',
'diff_after_tomorrow' => 'deman passat',
'period_recurrences' => ':count còp|:count còps',
'period_interval' => 'cada :interval',
'period_start_date' => 'de :date',
'period_end_date' => 'fins a :date',
];
src/Carbon/Lang/pa_IN.php 0000644 00000005105 15014555553 0011130 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'ਇੱਕ ਸਾਲ|:count ਸਾਲ',
'month' => 'ਇੱਕ ਮਹੀਨਾ|:count ਮਹੀਨੇ',
'week' => 'ਹਫਤਾ|:count ਹਫ਼ਤੇ',
'day' => 'ਇੱਕ ਦਿਨ|:count ਦਿਨ',
'hour' => 'ਇੱਕ ਘੰਟਾ|:count ਘੰਟੇ',
'minute' => 'ਇਕ ਮਿੰਟ|:count ਮਿੰਟ',
'second' => 'ਕੁਝ ਸਕਿੰਟ|:count ਸਕਿੰਟ',
'ago' => ':time ਪਿਛਲੇ',
'from_now' => ':time ਵਿੱਚ',
'diff_yesterday' => 'ਕਲ',
'diff_tomorrow' => 'ਕਲ',
'formats' => [
'LT' => 'A h:mm ਵਜੇ',
'LTS' => 'A h:mm:ss ਵਜੇ',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, A h:mm ਵਜੇ',
'LLLL' => 'dddd, D MMMM YYYY, A h:mm ਵਜੇ',
],
'calendar' => [
'sameDay' => '[ਅਜ] LT',
'nextDay' => '[ਕਲ] LT',
'nextWeek' => '[ਅਗਲਾ] dddd, LT',
'lastDay' => '[ਕਲ] LT',
'lastWeek' => '[ਪਿਛਲੇ] dddd, LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'ਰਾਤ';
}
if ($hour < 10) {
return 'ਸਵੇਰ';
}
if ($hour < 17) {
return 'ਦੁਪਹਿਰ';
}
if ($hour < 20) {
return 'ਸ਼ਾਮ';
}
return 'ਰਾਤ';
},
'months' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'],
'months_short' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'],
'weekdays' => ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨੀਚਰਵਾਰ'],
'weekdays_short' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'],
'weekdays_min' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'],
];
src/Carbon/Lang/pl.php 0000644 00000006001 15014555553 0010551 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count rok|:count lata|:count lat',
'y' => ':countr|:countl',
'month' => ':count miesiąc|:count miesiące|:count miesięcy',
'm' => ':countmies',
'week' => ':count tydzień|:count tygodnie|:count tygodni',
'w' => ':counttyg',
'day' => ':count dzień|:count dni|:count dni',
'd' => ':countd',
'hour' => ':count godzina|:count godziny|:count godzin',
'h' => ':countg',
'minute' => ':count minuta|:count minuty|:count minut',
'min' => ':countm',
'second' => ':count sekunda|:count sekundy|:count sekund',
's' => ':counts',
'ago' => ':time temu',
'from_now' => 'za :time',
'after' => ':time po',
'before' => ':time przed',
'diff_now' => 'przed chwilą',
'diff_yesterday' => 'wczoraj',
'diff_tomorrow' => 'jutro',
'diff_before_yesterday' => 'przedwczoraj',
'diff_after_tomorrow' => 'pojutrze',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Dziś o] LT',
'nextDay' => '[Jutro o] LT',
'nextWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[W niedzielę o] LT';
case 2:
return '[We wtorek o] LT';
case 3:
return '[W środę o] LT';
case 6:
return '[W sobotę o] LT';
default:
return '[W] dddd [o] LT';
}
},
'lastDay' => '[Wczoraj o] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[W zeszłą niedzielę o] LT';
case 3:
return '[W zeszłą środę o] LT';
case 6:
return '[W zeszłą sobotę o] LT';
default:
return '[W zeszły] dddd [o] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'],
'months_short' => ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'],
'weekdays' => ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'],
'weekdays_short' => ['ndz', 'pon', 'wt', 'śr', 'czw', 'pt', 'sob'],
'weekdays_min' => ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/ps.php 0000644 00000002061 15014555553 0010562 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count کال|:count کاله',
'y' => ':countکال|:countکاله',
'month' => ':count مياشت|:count مياشتي',
'm' => ':countمياشت|:countمياشتي',
'week' => ':count اونۍ|:count اونۍ',
'w' => ':countاونۍ|:countاونۍ',
'day' => ':count ورځ|:count ورځي',
'd' => ':countورځ|:countورځي',
'hour' => ':count ساعت|:count ساعته',
'h' => ':countساعت|:countساعته',
'minute' => ':count دقيقه|:count دقيقې',
'min' => ':countدقيقه|:countدقيقې',
'second' => ':count ثانيه|:count ثانيې',
's' => ':countثانيه|:countثانيې',
'ago' => ':time دمخه',
'from_now' => ':time له اوس څخه',
'after' => ':time وروسته',
'before' => ':time دمخه',
];
src/Carbon/Lang/pt.php 0000644 00000004425 15014555553 0010571 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'um ano|:count anos',
'y' => ':count ano|:count anos',
'month' => 'um mês|:count meses',
'm' => ':count mês|:count meses',
'week' => ':count semana|:count semanas',
'w' => ':count semana|:count semanas',
'day' => 'um dia|:count dias',
'd' => ':count dia|:count dias',
'hour' => 'uma hora|:count horas',
'h' => ':count hora|:count horas',
'minute' => 'um minuto|:count minutos',
'min' => ':count minuto|:count minutos',
'second' => 'segundos|:count segundos',
's' => ':count segundo|:count segundos',
'ago' => 'há :time',
'from_now' => 'em :time',
'after' => ':time depois',
'before' => ':time antes',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D [de] MMMM [de] YYYY',
'LLL' => 'D [de] MMMM [de] YYYY HH:mm',
'LLLL' => 'dddd, D [de] MMMM [de] YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Hoje às] LT',
'nextDay' => '[Amanhã às] LT',
'nextWeek' => 'dddd [às] LT',
'lastDay' => '[Ontem às] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
case 6:
return '[Último] dddd [às] LT';
default:
return '[Última] dddd [às] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':numberº',
'months' => ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'],
'months_short' => ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'],
'weekdays' => ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado'],
'weekdays_short' => ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
'weekdays_min' => ['Do', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sá'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/pt_BR.php 0000644 00000005006 15014555553 0011150 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'um ano|:count anos',
'y' => ':counta|:counta',
'month' => 'um mês|:count meses',
'm' => ':countm|:countm',
'week' => ':count semana|:count semanas',
'w' => ':countsem|:countsem',
'day' => 'um dia|:count dias',
'd' => ':countd|:countd',
'hour' => 'uma hora|:count horas',
'h' => ':counth|:counth',
'minute' => 'um minuto|:count minutos',
'min' => ':countmin|:countmin',
'second' => 'poucos segundos|:count segundos',
's' => ':counts|:counts',
'ago' => 'há :time',
'from_now' => 'em :time',
'after' => 'após :time',
'before' => ':time atrás',
'diff_now' => 'agora',
'diff_yesterday' => 'ontem',
'diff_tomorrow' => 'amanhã',
'diff_before_yesterday' => 'anteontem',
'diff_after_tomorrow' => 'depois de amanhã',
'period_recurrences' => 'uma|:count vez',
'period_interval' => 'toda :interval',
'period_start_date' => 'de :date',
'period_end_date' => 'até :date',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D [de] MMMM [de] YYYY',
'LLL' => 'D [de] MMMM [de] YYYY [às] HH:mm',
'LLLL' => 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',
],
'calendar' => [
'sameDay' => '[Hoje às] LT',
'nextDay' => '[Amanhã às] LT',
'nextWeek' => 'dddd [às] LT',
'lastDay' => '[Ontem às] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
case 6:
return '[Último] dddd [às] LT';
default:
return '[Última] dddd [às] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':numberº',
'months' => ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'],
'months_short' => ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'],
'weekdays' => ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado'],
'weekdays_short' => ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
'weekdays_min' => ['Do', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sá'],
];
src/Carbon/Lang/ro.php 0000644 00000004241 15014555553 0010562 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'un an|:count ani|:count ani',
'y' => 'un an|:count ani|:count ani',
'month' => 'o lună|:count luni|:count luni',
'm' => 'o lună|:count luni|:count luni',
'week' => 'o săptămână|:count săptămâni|:count săptămâni',
'w' => 'o săptămână|:count săptămâni|:count săptămâni',
'day' => 'o zi|:count zile|:count zile',
'd' => 'o zi|:count zile|:count zile',
'hour' => 'o oră|:count ore|:count ore',
'h' => 'o oră|:count ore|:count ore',
'minute' => 'un minut|:count minute|:count minute',
'min' => 'un minut|:count minute|:count minute',
'second' => 'o secundă|:count secunde|:count secunde',
's' => 'o secundă|:count secunde|:count secunde',
'ago' => ':time în urmă',
'from_now' => 'peste :time',
'after' => 'peste :time',
'before' => 'acum :time',
'diff_yesterday' => 'ieri',
'diff_tomorrow' => 'mâine',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY H:mm',
'LLLL' => 'dddd, D MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[azi la] LT',
'nextDay' => '[mâine la] LT',
'nextWeek' => 'dddd [la] LT',
'lastDay' => '[ieri la] LT',
'lastWeek' => '[fosta] dddd [la] LT',
'sameElse' => 'L',
],
'months' => ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'],
'months_short' => ['ian.', 'febr.', 'mart.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'],
'weekdays' => ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'],
'weekdays_short' => ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'],
'weekdays_min' => ['Du', 'Lu', 'Ma', 'Mi', 'Jo', 'Vi', 'Sâ'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ru.php 0000644 00000012147 15014555553 0010574 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count год|:count года|:count лет',
'y' => ':count г|:count г|:count л',
'month' => ':count месяц|:count месяца|:count месяцев',
'm' => ':count м|:count м|:count м',
'week' => ':count неделю|:count недели|:count недель',
'w' => ':count н|:count н|:count н',
'day' => ':count день|:count дня|:count дней',
'd' => ':count д|:count д|:count д',
'hour' => ':count час|:count часа|:count часов',
'h' => ':count ч|:count ч|:count ч',
'minute' => ':count минуту|:count минуты|:count минут',
'min' => ':count мин|:count мин|:count мин',
'second' => ':count секунду|:count секунды|:count секунд',
's' => ':count с|:count с|:count с',
'ago' => ':time назад',
'from_now' => 'через :time',
'after' => ':time после',
'before' => ':time до',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY г.',
'LLL' => 'D MMMM YYYY г., H:mm',
'LLLL' => 'dddd, D MMMM YYYY г., H:mm',
],
'calendar' => [
'sameDay' => '[Сегодня, в] LT',
'nextDay' => '[Завтра, в] LT',
'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) {
if ($current->week !== $other->week) {
switch ($current->dayOfWeek) {
case 0:
return '[В следующее] dddd, [в] LT';
case 1:
case 2:
case 4:
return '[В следующий] dddd, [в] LT';
case 3:
case 5:
case 6:
return '[В следующую] dddd, [в] LT';
}
}
if ($current->dayOfWeek === 2) {
return '[Во] dddd, [в] LT';
}
return '[В] dddd, [в] LT';
},
'lastDay' => '[Вчера, в] LT',
'lastWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) {
if ($current->week !== $other->week) {
switch ($current->dayOfWeek) {
case 0:
return '[В прошлое] dddd, [в] LT';
case 1:
case 2:
case 4:
return '[В прошлый] dddd, [в] LT';
case 3:
case 5:
case 6:
return '[В прошлую] dddd, [в] LT';
}
}
if ($current->dayOfWeek === 2) {
return '[Во] dddd, [в] LT';
}
return '[В] dddd, [в] LT';
},
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'M':
case 'd':
case 'DDD':
return $number.'-й';
case 'D':
return $number.'-го';
case 'w':
case 'W':
return $number.'-я';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'ночи';
}
if ($hour < 12) {
return 'утра';
}
if ($hour < 17) {
return 'дня';
}
return 'вечера';
},
'months' => ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'],
'months_standalone' => ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'],
'months_short' => ['янв.', 'февр.', 'мар.', 'апр.', 'мая', 'июня', 'июля', 'авг.', 'сент.', 'окт.', 'нояб.', 'дек.'],
'months_short_standalone' => ['янв.', 'февр.', 'март', 'апр.', 'май', 'июнь', 'июль', 'авг.', 'сент.', 'окт.', 'нояб.', 'дек.'],
'weekdays' => ['воскресенье', 'понедельник', 'вторник', 'среду', 'четверг', 'пятницу', 'субботу'],
'weekdays_standalone' => ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'],
'weekdays_short' => ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
'weekdays_min' => ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/sd.php 0000644 00000003775 15014555553 0010563 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$months = [
'جنوري',
'فيبروري',
'مارچ',
'اپريل',
'مئي',
'جون',
'جولاءِ',
'آگسٽ',
'سيپٽمبر',
'آڪٽوبر',
'نومبر',
'ڊسمبر',
];
$weekdays = [
'آچر',
'سومر',
'اڱارو',
'اربع',
'خميس',
'جمع',
'ڇنڇر',
];
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'sd');
return [
'year' => 'هڪ سال|:count سال',
'month' => 'هڪ مهينو|:count مهينا',
'week' => 'ھڪ ھفتو|:count هفتا',
'day' => 'هڪ ڏينهن|:count ڏينهن',
'hour' => 'هڪ ڪلاڪ|:count ڪلاڪ',
'minute' => 'هڪ منٽ|:count منٽ',
'second' => 'چند سيڪنڊ|:count سيڪنڊ',
'ago' => ':time اڳ',
'from_now' => ':time پوء',
'diff_yesterday' => 'ڪالهه',
'diff_tomorrow' => 'سڀاڻي',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd، D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[اڄ] LT',
'nextDay' => '[سڀاڻي] LT',
'nextWeek' => 'dddd [اڳين هفتي تي] LT',
'lastDay' => '[ڪالهه] LT',
'lastWeek' => '[گزريل هفتي] dddd [تي] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'صبح' : 'شام';
},
'months' => $months,
'months_short' => $months,
'weekdays' => $weekdays,
'weekdays_short' => $weekdays,
'weekdays_min' => $weekdays,
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/se.php 0000644 00000003741 15014555553 0010555 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'se');
return [
'year' => 'okta jahki|:count jagit',
'month' => 'okta mánnu|:count mánut',
'week' => 'okta vahkku|:count vahkku',
'day' => 'okta beaivi|:count beaivvit',
'hour' => 'okta diimmu|:count diimmut',
'minute' => 'okta minuhta|:count minuhtat',
'second' => 'moadde sekunddat|:count sekunddat',
'ago' => 'maŋit :time',
'from_now' => ':time geažes',
'diff_yesterday' => 'ikte',
'diff_tomorrow' => 'ihttin',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'MMMM D. [b.] YYYY',
'LLL' => 'MMMM D. [b.] YYYY [ti.] HH:mm',
'LLLL' => 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm',
],
'calendar' => [
'sameDay' => '[otne ti] LT',
'nextDay' => '[ihttin ti] LT',
'nextWeek' => 'dddd [ti] LT',
'lastDay' => '[ikte ti] LT',
'lastWeek' => '[ovddit] dddd [ti] LT',
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['ođđajagemánnu', 'guovvamánnu', 'njukčamánnu', 'cuoŋománnu', 'miessemánnu', 'geassemánnu', 'suoidnemánnu', 'borgemánnu', 'čakčamánnu', 'golggotmánnu', 'skábmamánnu', 'juovlamánnu'],
'months_short' => ['ođđj', 'guov', 'njuk', 'cuo', 'mies', 'geas', 'suoi', 'borg', 'čakč', 'golg', 'skáb', 'juov'],
'weekdays' => ['sotnabeaivi', 'vuossárga', 'maŋŋebárga', 'gaskavahkku', 'duorastat', 'bearjadat', 'lávvardat'],
'weekdays_short' => ['sotn', 'vuos', 'maŋ', 'gask', 'duor', 'bear', 'láv'],
'weekdays_min' => ['s', 'v', 'm', 'g', 'd', 'b', 'L'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/sh.php 0000644 00000002614 15014555553 0010556 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
}, 'sh');
return [
'year' => ':count godina|:count godine|:count godina',
'y' => ':count godina|:count godine|:count godina',
'month' => ':count mesec|:count meseca|:count meseci',
'm' => ':count mesec|:count meseca|:count meseci',
'week' => ':count nedelja|:count nedelje|:count nedelja',
'w' => ':count nedelja|:count nedelje|:count nedelja',
'day' => ':count dan|:count dana|:count dana',
'd' => ':count dan|:count dana|:count dana',
'hour' => ':count čas|:count časa|:count časova',
'h' => ':count čas|:count časa|:count časova',
'minute' => ':count minut|:count minuta|:count minuta',
'min' => ':count minut|:count minuta|:count minuta',
'second' => ':count sekund|:count sekunda|:count sekundi',
's' => ':count sekund|:count sekunda|:count sekundi',
'ago' => 'pre :time',
'from_now' => 'za :time',
'after' => 'nakon :time',
'before' => ':time raniјe',
];
src/Carbon/Lang/si.php 0000644 00000005133 15014555553 0010556 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'si');
return [
'year' => 'වසර|වසර :count',
'month' => 'මාසය|මාස :count',
'week' => 'සතියක්|සති :count යි',
'day' => 'දිනය|දින :count',
'hour' => 'පැය|පැය :count',
'minute' => 'මිනිත්තුව|මිනිත්තු :count',
'second' => 'තත්පර කිහිපය|තත්පර :count',
'ago' => ':timeකට පෙර',
'from_now' => ':timeකින්',
'diff_yesterday' => 'ඊයේ',
'diff_tomorrow' => 'හෙට',
'formats' => [
'LT' => 'a h:mm',
'LTS' => 'a h:mm:ss',
'L' => 'YYYY/MM/DD',
'LL' => 'YYYY MMMM D',
'LLL' => 'YYYY MMMM D, a h:mm',
'LLLL' => 'YYYY MMMM D [වැනි] dddd, a h:mm:ss',
],
'calendar' => [
'sameDay' => '[අද] LT[ට]',
'nextDay' => '[හෙට] LT[ට]',
'nextWeek' => 'dddd LT[ට]',
'lastDay' => '[ඊයේ] LT[ට]',
'lastWeek' => '[පසුගිය] dddd LT[ට]',
'sameElse' => 'L',
],
'ordinal' => ':number වැනි',
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour > 11) {
return $isLower ? 'ප.ව.' : 'පස් වරු';
}
return $isLower ? 'පෙ.ව.' : 'පෙර වරු';
},
'months' => ['ජනවාරි', 'පෙබරවාරි', 'මාර්තු', 'අප්රේල්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝස්තු', 'සැප්තැම්බර්', 'ඔක්තෝබර්', 'නොවැම්බර්', 'දෙසැම්බර්'],
'months_short' => ['ජන', 'පෙබ', 'මාර්', 'අප්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝ', 'සැප්', 'ඔක්', 'නොවැ', 'දෙසැ'],
'weekdays' => ['ඉරිදා', 'සඳුදා', 'අඟහරුවාදා', 'බදාදා', 'බ්රහස්පතින්දා', 'සිකුරාදා', 'සෙනසුරාදා'],
'weekdays_short' => ['ඉරි', 'සඳු', 'අඟ', 'බදා', 'බ්රහ', 'සිකු', 'සෙන'],
'weekdays_min' => ['ඉ', 'ස', 'අ', 'බ', 'බ්ර', 'සි', 'සෙ'],
];
src/Carbon/Lang/sk.php 0000644 00000003067 15014555553 0010564 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'rok|:count roky|:count rokov',
'y' => 'rok|:count roky|:count rokov',
'month' => 'mesiac|:count mesiace|:count mesiacov',
'm' => 'mesiac|:count mesiace|:count mesiacov',
'week' => 'týždeň|:count týždne|:count týždňov',
'w' => 'týždeň|:count týždne|:count týždňov',
'day' => 'deň|:count dni|:count dní',
'd' => 'deň|:count dni|:count dní',
'hour' => 'hodinu|:count hodiny|:count hodín',
'h' => 'hodinu|:count hodiny|:count hodín',
'minute' => 'minútu|:count minúty|:count minút',
'min' => 'minútu|:count minúty|:count minút',
'second' => 'sekundu|:count sekundy|:count sekúnd',
's' => 'sekundu|:count sekundy|:count sekúnd',
'ago' => 'pred :time',
'from_now' => 'za :time',
'after' => 'o :time neskôr',
'before' => ':time predtým',
'year_ago' => 'rokom|:count rokmi|:count rokmi',
'month_ago' => 'mesiacom|:count mesiacmi|:count mesiacmi',
'week_ago' => 'týždňom|:count týždňami|:count týždňami',
'day_ago' => 'dňom|:count dňami|:count dňami',
'hour_ago' => 'hodinou|:count hodinami|:count hodinami',
'minute_ago' => 'minútou|:count minútami|:count minútami',
'second_ago' => 'sekundou|:count sekundami|:count sekundami',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/sl.php 0000644 00000007334 15014555553 0010566 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count leto|:count leti|:count leta|:count let',
'y' => ':count leto|:count leti|:count leta|:count let',
'month' => ':count mesec|:count meseca|:count mesece|:count mesecev',
'm' => ':count mesec|:count meseca|:count mesece|:count mesecev',
'week' => ':count teden|:count tedna|:count tedne|:count tednov',
'w' => ':count teden|:count tedna|:count tedne|:count tednov',
'day' => ':count dan|:count dni|:count dni|:count dni',
'd' => ':count dan|:count dni|:count dni|:count dni',
'hour' => ':count uro|:count uri|:count ure|:count ur',
'h' => ':count uro|:count uri|:count ure|:count ur',
'minute' => ':count minuto|:count minuti|:count minute|:count minut',
'min' => ':count minuto|:count minuti|:count minute|:count minut',
'second' => ':count sekundo|:count sekundi|:count sekunde|:count sekund',
's' => ':count sekundo|:count sekundi|:count sekunde|:count sekund',
'year_ago' => ':count letom|:count leti|:count leti|:count leti',
'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci',
'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni',
'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi',
'hour_ago' => ':count uro|:count urama|:count urami|:count urami',
'minute_ago' => ':count minuto|:count minutama|:count minutami|:count minutami',
'second_ago' => ':count sekundo|:count sekundama|:count sekundami|:count sekundami',
'ago' => 'pred :time',
'from_now' => 'čez :time',
'after' => 'čez :time',
'before' => 'pred :time',
'diff_now' => 'ravnokar',
'diff_yesterday' => 'včeraj',
'diff_tomorrow' => 'jutri',
'diff_before_yesterday' => 'predvčerajšnjim',
'diff_after_tomorrow' => 'pojutrišnjem',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
'period_start_date' => 'od :date',
'period_end_date' => 'do :date',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY H:mm',
'LLLL' => 'dddd, D. MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[danes ob] LT',
'nextDay' => '[jutri ob] LT',
'nextWeek' => 'dddd [ob] LT',
'lastDay' => '[včeraj ob] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[preteklo] [nedeljo] [ob] LT';
case 1:
return '[pretekli] [ponedeljek] [ob] LT';
case 2:
return '[pretekli] [torek] [ob] LT';
case 3:
return '[preteklo] [sredo] [ob] LT';
case 4:
return '[pretekli] [četrtek] [ob] LT';
case 5:
return '[pretekli] [petek] [ob] LT';
case 6:
return '[preteklo] [soboto] [ob] LT';
}
},
'sameElse' => 'L',
],
'months' => ['Januar', 'Februar', 'Marec', 'April', 'Maj', 'Junij', 'Julij', 'Avgust', 'September', 'Oktober', 'November', 'December'],
'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'],
'weekdays' => ['Nedelja', 'Ponedeljek', 'Torek', 'Sreda', 'Četrtek', 'Petek', 'Sobota'],
'weekdays_short' => ['Ned', 'Pon', 'Tor', 'Sre', 'Čet', 'Pet', 'Sob'],
'weekdays_min' => ['Ne', 'Po', 'To', 'Sr', 'Če', 'Pe', 'So'],
];
src/Carbon/Lang/sq.php 0000644 00000004176 15014555553 0010574 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'një vit|:count vite',
'y' => ':count vit|:count vjet',
'month' => 'një muaj|:count muaj',
'm' => ':count muaj|:count muaj',
'week' => ':count javë|:count javë',
'w' => ':count javë|:count javë',
'day' => 'një ditë|:count ditë',
'd' => ':count ditë|:count ditë',
'hour' => 'një orë|:count orë',
'h' => ':count orë|:count orë',
'minute' => 'një minutë|:count minuta',
'min' => ':count minutë|:count minuta',
'second' => 'disa sekonda|:count sekonda',
's' => ':count sekondë|:count sekonda',
'ago' => ':time më parë',
'from_now' => 'në :time',
'after' => ':time pas',
'before' => ':time para',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Sot në] LT',
'nextDay' => '[Nesër në] LT',
'nextWeek' => 'dddd [në] LT',
'lastDay' => '[Dje në] LT',
'lastWeek' => 'dddd [e kaluar në] LT',
'sameElse' => 'L',
],
'ordinal' => ':number.',
'meridiem' => function ($hour, $minute, $isLower) {
$meridiem = $hour < 12 ? 'PD' : 'MD';
return $isLower ? strtolower($meridiem) : $meridiem;
},
'months' => ['Janar', 'Shkurt', 'Mars', 'Prill', 'Maj', 'Qershor', 'Korrik', 'Gusht', 'Shtator', 'Tetor', 'Nëntor', 'Dhjetor'],
'months_short' => ['Jan', 'Shk', 'Mar', 'Pri', 'Maj', 'Qer', 'Kor', 'Gus', 'Sht', 'Tet', 'Nën', 'Dhj'],
'weekdays' => ['E Diel', 'E Hënë', 'E Martë', 'E Mërkurë', 'E Enjte', 'E Premte', 'E Shtunë'],
'weekdays_short' => ['Die', 'Hën', 'Mar', 'Mër', 'Enj', 'Pre', 'Sht'],
'weekdays_min' => ['D', 'H', 'Ma', 'Më', 'E', 'P', 'Sh'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/sr.php 0000644 00000007375 15014555553 0010601 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count godina|:count godine|:count godina',
'y' => ':count godina|:count godine|:count godina',
'month' => ':count mesec|:count meseca|:count meseci',
'm' => ':count mesec|:count meseca|:count meseci',
'week' => ':count nedelja|:count nedelje|:count nedelja',
'w' => ':count nedelja|:count nedelje|:count nedelja',
'day' => ':count dan|:count dana|:count dana',
'd' => ':count dan|:count dana|:count dana',
'hour' => ':count sat|:count sata|:count sati',
'h' => ':count sat|:count sata|:count sati',
'minute' => ':count minut|:count minuta |:count minuta',
'min' => ':count minut|:count minuta |:count minuta',
'second' => ':count sekund|:count sekunde|:count sekunde',
's' => ':count sekund|:count sekunde|:count sekunde',
'ago' => 'pre :time',
'from_now' => 'za :time',
'after' => 'nakon :time',
'before' => 'pre :time',
'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
'week_from_now' => '{1} :count nedelju|{2,3,4} :count nedelje|[5,Inf[ :count nedelja',
'week_ago' => '{1} :count nedelju|{2,3,4} :count nedelje|[5,Inf[ :count nedelja',
'diff_yesterday' => 'juče',
'diff_tomorrow' => 'sutra',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY H:mm',
'LLLL' => 'dddd, D. MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[danas u] LT',
'nextDay' => '[sutra u] LT',
'nextWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[у недељу у] LT';
case 3:
return '[у среду у] LT';
case 6:
return '[у суботу у] LT';
default:
return '[у] dddd [у] LT';
}
},
'lastDay' => '[juče u] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[прошле недеље у] LT';
case 1:
return '[прошлог понедељка у] LT';
case 2:
return '[прошлог уторка у] LT';
case 3:
return '[прошле среде у] LT';
case 4:
return '[прошлог четвртка у] LT';
case 5:
return '[прошлог петка у] LT';
default:
return '[прошле суботе у] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],
'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],
'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],
'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'],
'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/sr_Cyrl.php 0000644 00000010400 15014555553 0011551 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[ :count година',
'y' => ':count г.',
'month' => '{1} :count месец|{2,3,4}:count месеца|[5,Inf[ :count месеци',
'm' => ':count м.',
'week' => '{1} :count недеља|{2,3,4}:count недеље|[5,Inf[ :count недеља',
'w' => ':count нед.',
'day' => '{1,21,31} :count дан|[2,Inf[ :count дана',
'd' => ':count д.',
'hour' => '{1,21} :count сат|{2,3,4,22,23,24}:count сата|[5,Inf[ :count сати',
'h' => ':count ч.',
'minute' => '{1,21,31,41,51} :count минут|[2,Inf[ :count минута',
'min' => ':count мин.',
'second' => '{1,21,31,41,51} :count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[5,Inf[:count секунди',
's' => ':count сек.',
'ago' => 'пре :time',
'from_now' => 'за :time',
'after' => ':time након',
'before' => ':time пре',
'year_from_now' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
'year_ago' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
'week_from_now' => '{1} :count недељу|{2,3,4} :count недеље|[5,Inf[ :count недеља',
'week_ago' => '{1} :count недељу|{2,3,4} :count недеље|[5,Inf[ :count недеља',
'diff_now' => 'управо сада',
'diff_yesterday' => 'јуче',
'diff_tomorrow' => 'сутра',
'diff_before_yesterday' => 'прекјуче',
'diff_after_tomorrow' => 'прекосутра',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY H:mm',
'LLLL' => 'dddd, D. MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[данас у] LT',
'nextDay' => '[сутра у] LT',
'nextWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[у недељу у] LT';
case 3:
return '[у среду у] LT';
case 6:
return '[у суботу у] LT';
default:
return '[у] dddd [у] LT';
}
},
'lastDay' => '[јуче у] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[прошле недеље у] LT';
case 1:
return '[прошлог понедељка у] LT';
case 2:
return '[прошлог уторка у] LT';
case 3:
return '[прошле среде у] LT';
case 4:
return '[прошлог четвртка у] LT';
case 5:
return '[прошлог петка у] LT';
default:
return '[прошле суботе у] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'],
'months_short' => ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'],
'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'],
'weekdays_short' => ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'],
'weekdays_min' => ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/sr_Cyrl_ME.php 0000644 00000010447 15014555553 0012145 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[ :count година',
'y' => ':count г.',
'month' => '{1} :count мјесец|{2,3,4}:count мјесеца|[5,Inf[ :count мјесеци',
'm' => ':count мј.',
'week' => '{1} :count недјеља|{2,3,4}:count недјеље|[5,Inf[ :count недјеља',
'w' => ':count нед.',
'day' => '{1,21,31} :count дан|[2,Inf[ :count дана',
'd' => ':count д.',
'hour' => '{1,21} :count сат|{2,3,4,22,23,24}:count сата|[5,Inf[ :count сати',
'h' => ':count ч.',
'minute' => '{1,21,31,41,51} :count минут|[2,Inf[ :count минута',
'min' => ':count мин.',
'second' => '{1,21,31,41,51} :count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[5,Inf[:count секунди',
's' => ':count сек.',
'ago' => 'прије :time',
'from_now' => 'за :time',
'after' => ':time након',
'before' => ':time прије',
'year_from_now' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
'year_ago' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
'week_from_now' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља',
'week_ago' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља',
'diff_now' => 'управо сада',
'diff_yesterday' => 'јуче',
'diff_tomorrow' => 'сутра',
'diff_before_yesterday' => 'прекјуче',
'diff_after_tomorrow' => 'прекосјутра',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM YYYY',
'LLL' => 'D. MMMM YYYY H:mm',
'LLLL' => 'dddd, D. MMMM YYYY H:mm',
],
'calendar' => [
'sameDay' => '[данас у] LT',
'nextDay' => '[сутра у] LT',
'nextWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[у недељу у] LT';
case 3:
return '[у среду у] LT';
case 6:
return '[у суботу у] LT';
default:
return '[у] dddd [у] LT';
}
},
'lastDay' => '[јуче у] LT',
'lastWeek' => function (\Carbon\CarbonInterface $date) {
switch ($date->dayOfWeek) {
case 0:
return '[прошле недеље у] LT';
case 1:
return '[прошлог понедељка у] LT';
case 2:
return '[прошлог уторка у] LT';
case 3:
return '[прошле среде у] LT';
case 4:
return '[прошлог четвртка у] LT';
case 5:
return '[прошлог петка у] LT';
default:
return '[прошле суботе у] LT';
}
},
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'],
'months_short' => ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'],
'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'],
'weekdays_short' => ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'],
'weekdays_min' => ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/sr_Latn_ME.php 0000644 00000003466 15014555553 0012135 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count godine|[0,Inf[ :count godina',
'y' => ':count g.',
'month' => '{1} :count mjesec|{2,3,4}:count mjeseca|[5,Inf[ :count mjeseci',
'm' => ':count mj.',
'week' => '{1} :count nedjelja|{2,3,4}:count nedjelje|[5,Inf[ :count nedjelja',
'w' => ':count ned.',
'day' => '{1,21,31} :count dan|[2,Inf[ :count dana',
'd' => ':count d.',
'hour' => '{1,21} :count sat|{2,3,4,22,23,24}:count sata|[5,Inf[ :count sati',
'h' => ':count č.',
'minute' => '{1,21,31,41,51} :count minut|[2,Inf[ :count minuta',
'min' => ':count min.',
'second' => '{1,21,31,41,51} :count sekund|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count sekunde|[5,Inf[:count sekundi',
's' => ':count sek.',
'ago' => 'prije :time',
'from_now' => 'za :time',
'after' => ':time nakon',
'before' => ':time prije',
'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
'week_from_now' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
'week_ago' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
'diff_now' => 'upravo sada',
'diff_yesterday' => 'juče',
'diff_tomorrow' => 'sutra',
'diff_before_yesterday' => 'prekjuče',
'diff_after_tomorrow' => 'preksutra',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/sr_ME.php 0000644 00000000422 15014555553 0011144 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return require __DIR__.'/sr_Latn_ME.php';
src/Carbon/Lang/ss.php 0000644 00000004603 15014555553 0010571 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'ss');
return [
'year' => 'umnyaka|:count iminyaka',
'month' => 'inyanga|:count tinyanga',
'week' => ':count liviki|:count emaviki',
'day' => 'lilanga|:count emalanga',
'hour' => 'lihora|:count emahora',
'minute' => 'umzuzu|:count emizuzu',
'second' => 'emizuzwana lomcane|:count mzuzwana',
'ago' => 'wenteka nga :time',
'from_now' => 'nga :time',
'diff_yesterday' => 'Itolo',
'diff_tomorrow' => 'Kusasa',
'formats' => [
'LT' => 'h:mm A',
'LTS' => 'h:mm:ss A',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY h:mm A',
'LLLL' => 'dddd, D MMMM YYYY h:mm A',
],
'calendar' => [
'sameDay' => '[Namuhla nga] LT',
'nextDay' => '[Kusasa nga] LT',
'nextWeek' => 'dddd [nga] LT',
'lastDay' => '[Itolo nga] LT',
'lastWeek' => 'dddd [leliphelile] [nga] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
$lastDigit = $number % 10;
return $number.(
(~~($number % 100 / 10) === 1) ? 'e' : (
($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e'
)
);
},
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 11) {
return 'ekuseni';
}
if ($hour < 15) {
return 'emini';
}
if ($hour < 19) {
return 'entsambama';
}
return 'ebusuku';
},
'months' => ['Bhimbidvwane', 'Indlovana', 'Indlov\'lenkhulu', 'Mabasa', 'Inkhwekhweti', 'Inhlaba', 'Kholwane', 'Ingci', 'Inyoni', 'Imphala', 'Lweti', 'Ingongoni'],
'months_short' => ['Bhi', 'Ina', 'Inu', 'Mab', 'Ink', 'Inh', 'Kho', 'Igc', 'Iny', 'Imp', 'Lwe', 'Igo'],
'weekdays' => ['Lisontfo', 'Umsombuluko', 'Lesibili', 'Lesitsatfu', 'Lesine', 'Lesihlanu', 'Umgcibelo'],
'weekdays_short' => ['Lis', 'Umb', 'Lsb', 'Les', 'Lsi', 'Lsh', 'Umg'],
'weekdays_min' => ['Li', 'Us', 'Lb', 'Lt', 'Ls', 'Lh', 'Ug'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/sv.php 0000644 00000004403 15014555553 0010572 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'ett år|:count år',
'y' => ':count år|:count år',
'month' => 'en månad|:count månader',
'm' => ':count månad|:count månader',
'week' => ':count vecka|:count veckor',
'w' => ':count vecka|:count veckor',
'day' => 'en dag|:count dagar',
'd' => ':count dag|:count dagar',
'hour' => 'en timme|:count timmar',
'h' => ':count timme|:count timmar',
'minute' => 'en minut|:count minuter',
'min' => ':count minut|:count minuter',
'second' => 'några sekunder|:count sekunder',
's' => ':count sekund|:count sekunder',
'ago' => 'för :time sedan',
'from_now' => 'om :time',
'after' => ':time efter',
'before' => ':time före',
'diff_yesterday' => 'Igår',
'diff_tomorrow' => 'Imorgon',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY-MM-DD',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY [kl.] HH:mm',
'LLLL' => 'dddd D MMMM YYYY [kl.] HH:mm',
],
'calendar' => [
'sameDay' => '[Idag] LT',
'nextDay' => '[Imorgon] LT',
'nextWeek' => '[På] dddd LT',
'lastDay' => '[Igår] LT',
'lastWeek' => '[I] dddd[s] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
$lastDigit = $number % 10;
return $number.(
(~~($number % 100 / 10) === 1) ? 'e' : (
($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e'
)
);
},
'months' => ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'],
'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
'weekdays' => ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'],
'weekdays_short' => ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'],
'weekdays_min' => ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/sw.php 0000644 00000003654 15014555553 0010602 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'mwaka mmoja|miaka :count',
'y' => 'mwaka 1|miaka :count',
'month' => 'mwezi mmoja|miezi :count',
'm' => 'mwezi 1|miezi :count',
'week' => 'wiki 1|wiki :count',
'w' => 'wiki 1|wiki :count',
'day' => 'siku moja|masiku :count',
'd' => 'siku 1|siku :count',
'hour' => 'saa limoja|masaa :count',
'h' => 'saa 1|masaa :count',
'minute' => 'dakika moja|dakika :count',
'min' => 'dakika 1|dakika :count',
'second' => 'hivi punde|sekunde :count',
's' => 'sekunde 1|sekunde :count',
'ago' => 'tokea :time',
'from_now' => ':time baadaye',
'after' => ':time baada',
'before' => ':time kabla',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[leo saa] LT',
'nextDay' => '[kesho saa] LT',
'nextWeek' => '[wiki ijayo] dddd [saat] LT',
'lastDay' => '[jana] LT',
'lastWeek' => '[wiki iliyopita] dddd [saat] LT',
'sameElse' => 'L',
],
'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'],
'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'],
'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'],
'weekdays_short' => ['Jpl', 'Jtat', 'Jnne', 'Jtan', 'Alh', 'Ijm', 'Jmos'],
'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ta.php 0000644 00000006261 15014555553 0010552 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'ஒரு வருடம்|:count ஆண்டுகள்',
'month' => 'ஒரு மாதம்|:count மாதங்கள்',
'week' => 'ஒரு வாரம்|:count வாரங்கள்',
'day' => 'ஒரு நாள்|:count நாட்கள்',
'hour' => 'ஒரு மணி நேரம்|:count மணி நேரம்',
'minute' => 'ஒரு நிமிடம்|:count நிமிடங்கள்',
'second' => 'ஒரு சில விநாடிகள்|:count விநாடிகள்',
'ago' => ':time முன்',
'from_now' => ':time இல்',
'diff_yesterday' => 'நேற்று',
'diff_tomorrow' => 'நாளை',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, HH:mm',
'LLLL' => 'dddd, D MMMM YYYY, HH:mm',
],
'calendar' => [
'sameDay' => '[இன்று] LT',
'nextDay' => '[நாளை] LT',
'nextWeek' => 'dddd, LT',
'lastDay' => '[நேற்று] LT',
'lastWeek' => '[கடந்த வாரம்] dddd, LT',
'sameElse' => 'L',
],
'ordinal' => ':numberவது',
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 2) {
return ' யாமம்';
}
if ($hour < 6) {
return ' வைகறை';
}
if ($hour < 10) {
return ' காலை';
}
if ($hour < 14) {
return ' நண்பகல்';
}
if ($hour < 18) {
return ' எற்பாடு';
}
if ($hour < 22) {
return ' மாலை';
}
return ' யாமம்';
},
'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டெம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'],
'months_short' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டெம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'],
'weekdays' => ['ஞாயிற்றுக்கிழமை', 'திங்கட்கிழமை', 'செவ்வாய்கிழமை', 'புதன்கிழமை', 'வியாழக்கிழமை', 'வெள்ளிக்கிழமை', 'சனிக்கிழமை'],
'weekdays_short' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'],
'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'],
];
src/Carbon/Lang/te.php 0000644 00000005315 15014555553 0010555 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => 'ఒక సంవత్సరం|:count సంవత్సరాలు',
'month' => 'ఒక నెల|:count నెలలు',
'week' => 'ఒక వారం|:count వారాలు',
'day' => 'ఒక రోజు|:count రోజులు',
'hour' => 'ఒక గంట|:count గంటలు',
'minute' => 'ఒక నిమిషం|:count నిమిషాలు',
'second' => 'కొన్ని క్షణాలు|:count సెకన్లు',
'ago' => ':time క్రితం',
'from_now' => ':time లో',
'diff_yesterday' => 'నిన్న',
'diff_tomorrow' => 'రేపు',
'formats' => [
'LT' => 'A h:mm',
'LTS' => 'A h:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY, A h:mm',
'LLLL' => 'dddd, D MMMM YYYY, A h:mm',
],
'calendar' => [
'sameDay' => '[నేడు] LT',
'nextDay' => '[రేపు] LT',
'nextWeek' => 'dddd, LT',
'lastDay' => '[నిన్న] LT',
'lastWeek' => '[గత] dddd, LT',
'sameElse' => 'L',
],
'ordinal' => ':numberవ',
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'రాత్రి';
}
if ($hour < 10) {
return 'ఉదయం';
}
if ($hour < 17) {
return 'మధ్యాహ్నం';
}
if ($hour < 20) {
return 'సాయంత్రం';
}
return ' రాత్రి';
},
'months' => ['జనవరి', 'ఫిబ్రవరి', 'మార్చి', 'ఏప్రిల్', 'మే', 'జూన్', 'జూలై', 'ఆగస్టు', 'సెప్టెంబర్', 'అక్టోబర్', 'నవంబర్', 'డిసెంబర్'],
'months_short' => ['జన.', 'ఫిబ్ర.', 'మార్చి', 'ఏప్రి.', 'మే', 'జూన్', 'జూలై', 'ఆగ.', 'సెప్.', 'అక్టో.', 'నవ.', 'డిసె.'],
'weekdays' => ['ఆదివారం', 'సోమవారం', 'మంగళవారం', 'బుధవారం', 'గురువారం', 'శుక్రవారం', 'శనివారం'],
'weekdays_short' => ['ఆది', 'సోమ', 'మంగళ', 'బుధ', 'గురు', 'శుక్ర', 'శని'],
'weekdays_min' => ['ఆ', 'సో', 'మం', 'బు', 'గు', 'శు', 'శ'],
];
src/Carbon/Lang/tet.php 0000644 00000003476 15014555553 0010747 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'tet');
return [
'year' => 'tinan ida|tinan :count',
'month' => 'fulan ida|fulan :count',
'week' => 'semana ida|semana :count',
'day' => 'loron ida|loron :count',
'hour' => 'oras ida|oras :count',
'minute' => 'minutu ida|minutu :count',
'second' => 'minutu balun|minutu :count',
'ago' => ':time liuba',
'from_now' => 'iha :time',
'diff_yesterday' => 'Horiseik',
'diff_tomorrow' => 'Aban',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Ohin iha] LT',
'nextDay' => '[Aban iha] LT',
'nextWeek' => 'dddd [iha] LT',
'lastDay' => '[Horiseik iha] LT',
'lastWeek' => 'dddd [semana kotuk] [iha] LT',
'sameElse' => 'L',
],
'ordinal' => ':numberº',
'months' => ['Janeiru', 'Fevereiru', 'Marsu', 'Abril', 'Maiu', 'Juñu', 'Jullu', 'Agustu', 'Setembru', 'Outubru', 'Novembru', 'Dezembru'],
'months_short' => ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
'weekdays' => ['Domingu', 'Segunda', 'Tersa', 'Kuarta', 'Kinta', 'Sesta', 'Sabadu'],
'weekdays_short' => ['Dom', 'Seg', 'Ters', 'Kua', 'Kint', 'Sest', 'Sab'],
'weekdays_min' => ['Do', 'Seg', 'Te', 'Ku', 'Ki', 'Ses', 'Sa'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/tg.php 0000644 00000006402 15014555553 0010555 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'tg');
return [
'year' => 'як сол|:count сол',
'month' => 'як моҳ|:count моҳ',
'week' => 'як ҳафта|:count ҳафта',
'day' => 'як рӯз|:count рӯз',
'hour' => 'як соат|:count соат',
'minute' => 'як дақиқа|:count дақиқа',
'second' => 'якчанд сония|:count сония',
'ago' => ':time пеш',
'from_now' => 'баъди :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Имрӯз соати] LT',
'nextDay' => '[Пагоҳ соати] LT',
'nextWeek' => 'dddd[и] [ҳафтаи оянда соати] LT',
'lastDay' => '[Дирӯз соати] LT',
'lastWeek' => 'dddd[и] [ҳафтаи гузашта соати] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
if ($number === 0) { // special case for zero
return "$number-ıncı";
}
static $suffixes = [
0 => '-ум',
1 => '-ум',
2 => '-юм',
3 => '-юм',
4 => '-ум',
5 => '-ум',
6 => '-ум',
7 => '-ум',
8 => '-ум',
9 => '-ум',
10 => '-ум',
12 => '-ум',
13 => '-ум',
20 => '-ум',
30 => '-юм',
40 => '-ум',
50 => '-ум',
60 => '-ум',
70 => '-ум',
80 => '-ум',
90 => '-ум',
100 => '-ум',
];
return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? '');
},
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'шаб';
}
if ($hour < 11) {
return 'субҳ';
}
if ($hour < 16) {
return 'рӯз';
}
if ($hour < 19) {
return 'бегоҳ';
}
return 'шаб';
},
'months' => ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'],
'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'],
'weekdays' => ['якшанбе', 'душанбе', 'сешанбе', 'чоршанбе', 'панҷшанбе', 'ҷумъа', 'шанбе'],
'weekdays_short' => ['яшб', 'дшб', 'сшб', 'чшб', 'пшб', 'ҷум', 'шнб'],
'weekdays_min' => ['яш', 'дш', 'сш', 'чш', 'пш', 'ҷм', 'шб'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/th.php 0000644 00000005265 15014555553 0010564 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count ปี',
'y' => ':count ปี',
'month' => ':count เดือน',
'm' => ':count เดือน',
'week' => ':count สัปดาห์',
'w' => ':count สัปดาห์',
'day' => ':count วัน',
'd' => ':count วัน',
'hour' => ':count ชั่วโมง',
'h' => ':count ชั่วโมง',
'minute' => ':count นาที',
'min' => ':count นาที',
'second' => '{1}ไม่กี่วินาที|]1,Inf[:count วินาที',
's' => ':count วินาที',
'ago' => ':timeที่แล้ว',
'from_now' => 'อีก :time',
'after' => ':timeหลังจากนี้',
'before' => ':timeก่อน',
'formats' => [
'LT' => 'H:mm',
'LTS' => 'H:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY เวลา H:mm',
'LLLL' => 'วันddddที่ D MMMM YYYY เวลา H:mm',
],
'calendar' => [
'sameDay' => '[วันนี้ เวลา] LT',
'nextDay' => '[พรุ่งนี้ เวลา] LT',
'nextWeek' => 'dddd[หน้า เวลา] LT',
'lastDay' => '[เมื่อวานนี้ เวลา] LT',
'lastWeek' => '[วัน]dddd[ที่แล้ว เวลา] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'ก่อนเที่ยง' : 'หลังเที่ยง';
},
'months' => ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'],
'months_short' => ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'],
'weekdays' => ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'],
'weekdays_short' => ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'],
'weekdays_min' => ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
];
src/Carbon/Lang/tl_PH.php 0000644 00000003400 15014555553 0011144 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'tl');
return [
'year' => 'isang taon|:count taon',
'month' => 'isang buwan|:count buwan',
'week' => 'isang linggo|:count linggo',
'day' => 'isang araw|:count araw',
'hour' => 'isang oras|:count oras',
'minute' => 'isang minuto|:count minuto',
'second' => 'ilang segundo|:count segundo',
'ago' => ':time ang nakalipas',
'from_now' => 'sa loob ng :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'MM/D/YYYY',
'LL' => 'MMMM D, YYYY',
'LLL' => 'MMMM D, YYYY HH:mm',
'LLLL' => 'dddd, MMMM DD, YYYY HH:mm',
],
'calendar' => [
'sameDay' => 'LT [ngayong araw]',
'nextDay' => '[Bukas ng] LT',
'nextWeek' => 'LT [sa susunod na] dddd',
'lastDay' => 'LT [kahapon]',
'lastWeek' => 'LT [noong nakaraang] dddd',
'sameElse' => 'L',
],
'months' => ['Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre'],
'months_short' => ['Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis'],
'weekdays' => ['Linggo', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado'],
'weekdays_short' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'],
'weekdays_min' => ['Li', 'Lu', 'Ma', 'Mi', 'Hu', 'Bi', 'Sab'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/tlh.php 0000644 00000004702 15014555553 0010733 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'tlh');
return [
'year' => 'wa’ DIS|:count DIS',
'month' => 'wa’ jar|:count jar',
'week' => 'wa’ hogh|:count hogh',
'day' => 'wa’ jaj|:count jaj',
'hour' => 'wa’ rep|:count rep',
'minute' => 'wa’ tup|:count tup',
'second' => 'puS lup|:count lup',
'ago' => function ($time) {
$output = strtr($time, [
'jaj' => 'Hu’',
'jar' => 'wen',
'DIS' => 'ben',
]);
return $output === $time ? "$time ret" : $output;
},
'from_now' => function ($time) {
$output = strtr($time, [
'jaj' => 'leS',
'jar' => 'waQ',
'DIS' => 'nem',
]);
return $output === $time ? "$time pIq" : $output;
},
'diff_yesterday' => 'wa’Hu’',
'diff_tomorrow' => 'wa’leS',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[DaHjaj] LT',
'nextDay' => '[wa’leS] LT',
'nextWeek' => 'LLL',
'lastDay' => '[wa’Hu’] LT',
'lastWeek' => 'LLL',
'sameElse' => 'L',
],
'ordinal' => ':number.',
'months' => ['tera’ jar wa’', 'tera’ jar cha’', 'tera’ jar wej', 'tera’ jar loS', 'tera’ jar vagh', 'tera’ jar jav', 'tera’ jar Soch', 'tera’ jar chorgh', 'tera’ jar Hut', 'tera’ jar wa’maH', 'tera’ jar wa’maH wa’', 'tera’ jar wa’maH cha’'],
'months_short' => ['jar wa’', 'jar cha’', 'jar wej', 'jar loS', 'jar vagh', 'jar jav', 'jar Soch', 'jar chorgh', 'jar Hut', 'jar wa’maH', 'jar wa’maH wa’', 'jar wa’maH cha’'],
'weekdays' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'],
'weekdays_short' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'],
'weekdays_min' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/tr.php 0000644 00000006500 15014555553 0010567 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}bir yıl|]1,Inf[:count yıl',
'y' => ':count yıl',
'month' => '{1}bir ay|]1,Inf[:count ay',
'm' => ':count ay',
'week' => '{1}bir hafta|]1,Inf[:count hafta',
'w' => ':count hafta',
'day' => '{1}bir gün|]1,Inf[:count gün',
'd' => ':count gün',
'hour' => '{1}bir saat|]1,Inf[:count saat',
'h' => ':count saat',
'minute' => '{1}bir dakika|]1,Inf[:count dakika',
'min' => ':count dakika',
'second' => '{1}birkaç saniye|]1,Inf[:count saniye',
's' => ':count saniye',
'ago' => ':time önce',
'from_now' => ':time sonra',
'after' => ':time sonra',
'before' => ':time önce',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[bugün saat] LT',
'nextDay' => '[yarın saat] LT',
'nextWeek' => '[gelecek] dddd [saat] LT',
'lastDay' => '[dün] LT',
'lastWeek' => '[geçen] dddd [saat] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'd':
case 'D':
case 'Do':
case 'DD':
return $number;
default:
if ($number === 0) { // special case for zero
return "$number'ıncı";
}
static $suffixes = [
1 => '\'inci',
5 => '\'inci',
8 => '\'inci',
70 => '\'inci',
80 => '\'inci',
2 => '\'nci',
7 => '\'nci',
20 => '\'nci',
50 => '\'nci',
3 => '\'üncü',
4 => '\'üncü',
100 => '\'üncü',
6 => '\'ncı',
9 => '\'uncu',
10 => '\'uncu',
30 => '\'uncu',
60 => '\'ıncı',
90 => '\'ıncı',
];
$lastDigit = $number % 10;
return $number.($suffixes[$lastDigit] ?? $suffixes[$number % 100 - $lastDigit] ?? $suffixes[$number >= 100 ? 100 : -1] ?? '');
}
},
'meridiem' => function ($hours, $minutes, $isLower) {
if ($hours < 12) {
return $isLower ? 'öö' : 'ÖÖ';
}
return $isLower ? 'ös' : 'ÖS';
},
'months' => ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
'months_short' => ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
'weekdays' => ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
'weekdays_short' => ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'],
'weekdays_min' => ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/tzl.php 0000644 00000004473 15014555553 0010762 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number > 1 ? 1 : 0;
}, 'tzl');
return [
'year' => ':count ar|:count ars',
'y' => ':count ar|:count ars',
'month' => ':count mes|:count mesen',
'm' => ':count mes|:count mesen',
'week' => ':count seifetziua|:count seifetziuas',
'w' => ':count seifetziua|:count seifetziuas',
'day' => ':count ziua|:count ziuas',
'd' => ':count ziua|:count ziuas',
'hour' => ':count þora|:count þoras',
'h' => ':count þora|:count þoras',
'minute' => ':count míut|:count míuts',
'min' => ':count míut|:count míuts',
'second' => ':count secunds',
's' => ':count secunds',
'ago' => 'ja:time',
'from_now' => 'osprei :time',
'diff_yesterday' => 'ieiri',
'diff_tomorrow' => 'demà',
'formats' => [
'LT' => 'HH.mm',
'LTS' => 'HH.mm.ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D. MMMM [dallas] YYYY',
'LLL' => 'D. MMMM [dallas] YYYY HH.mm',
'LLLL' => 'dddd, [li] D. MMMM [dallas] YYYY HH.mm',
],
'calendar' => [
'sameDay' => '[oxhi à] LT',
'nextDay' => '[demà à] LT',
'nextWeek' => 'dddd [à] LT',
'lastDay' => '[ieiri à] LT',
'lastWeek' => '[sür el] dddd [lasteu à] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
$meridiem = 'D\''.($hour > 11 ? 'O' : 'A');
return $isLower ? strtolower($meridiem) : $meridiem;
},
'months' => ['Januar', 'Fevraglh', 'Març', 'Avrïu', 'Mai', 'Gün', 'Julia', 'Guscht', 'Setemvar', 'Listopäts', 'Noemvar', 'Zecemvar'],
'months_short' => ['Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Gün', 'Jul', 'Gus', 'Set', 'Lis', 'Noe', 'Zec'],
'weekdays' => ['Súladi', 'Lúneçi', 'Maitzi', 'Márcuri', 'Xhúadi', 'Viénerçi', 'Sáturi'],
'weekdays_short' => ['Súl', 'Lún', 'Mai', 'Már', 'Xhú', 'Vié', 'Sát'],
'weekdays_min' => ['Sú', 'Lú', 'Ma', 'Má', 'Xh', 'Vi', 'Sá'],
'ordinal' => ':number.',
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/tzm.php 0000644 00000004642 15014555553 0010761 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'tzm');
return [
'year' => 'ⴰⵙⴳⴰⵙ|:count ⵉⵙⴳⴰⵙⵏ',
'month' => 'ⴰⵢoⵓⵔ|:count ⵉⵢⵢⵉⵔⵏ',
'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ',
'day' => 'ⴰⵙⵙ|:count oⵙⵙⴰⵏ',
'hour' => 'ⵙⴰⵄⴰ|:count ⵜⴰⵙⵙⴰⵄⵉⵏ',
'minute' => 'ⵎⵉⵏⵓⴺ|:count ⵎⵉⵏⵓⴺ',
'second' => 'ⵉⵎⵉⴽ|:count ⵉⵎⵉⴽ',
'ago' => 'ⵢⴰⵏ :time',
'from_now' => 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ :time',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[ⴰⵙⴷⵅ ⴴ] LT',
'nextDay' => '[ⴰⵙⴽⴰ ⴴ] LT',
'nextWeek' => 'dddd [ⴴ] LT',
'lastDay' => '[ⴰⵚⴰⵏⵜ ⴴ] LT',
'lastWeek' => 'dddd [ⴴ] LT',
'sameElse' => 'L',
],
'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⵏⴱⵉⵔ'],
'months_short' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⵏⴱⵉⵔ'],
'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'],
'weekdays_short' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'],
'weekdays_min' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/tzm_Latn.php 0000644 00000003534 15014555553 0011736 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'tzm');
return [
'year' => 'asgas|:count isgasn',
'month' => 'ayowr|:count iyyirn',
'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ',
'day' => 'ass|:count ossan',
'hour' => 'saɛa|:count tassaɛin',
'minute' => 'minuḍ|:count minuḍ',
'second' => 'imik|:count imik',
'ago' => 'yan :time',
'from_now' => 'dadkh s yan :time',
'diff_yesterday' => 'assant',
'diff_tomorrow' => 'aska',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[asdkh g] LT',
'nextDay' => '[aska g] LT',
'nextWeek' => 'dddd [g] LT',
'lastDay' => '[assant g] LT',
'lastWeek' => 'dddd [g] LT',
'sameElse' => 'L',
],
'months' => ['innayr', 'brˤayrˤ', 'marˤsˤ', 'ibrir', 'mayyw', 'ywnyw', 'ywlywz', 'ɣwšt', 'šwtanbir', 'ktˤwbrˤ', 'nwwanbir', 'dwjnbir'],
'months_short' => ['innayr', 'brˤayrˤ', 'marˤsˤ', 'ibrir', 'mayyw', 'ywnyw', 'ywlywz', 'ɣwšt', 'šwtanbir', 'ktˤwbrˤ', 'nwwanbir', 'dwjnbir'],
'weekdays' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'],
'weekdays_short' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'],
'weekdays_min' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ug_CN.php 0000644 00000006015 15014555553 0011136 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'ug');
return [
'year' => 'بىر يىل|:count يىل',
'month' => 'بىر ئاي|:count ئاي',
'week' => 'بىر ھەپتە|:count ھەپتە',
'day' => 'بىر كۈن|:count كۈن',
'hour' => 'بىر سائەت|:count سائەت',
'minute' => 'بىر مىنۇت|:count مىنۇت',
'second' => 'نەچچە سېكونت|:count سېكونت',
'ago' => ':time بۇرۇن',
'from_now' => ':time كېيىن',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY-MM-DD',
'LL' => 'YYYY-يىلىM-ئاينىڭD-كۈنى',
'LLL' => 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
'LLLL' => 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
],
'calendar' => [
'sameDay' => '[بۈگۈن سائەت] LT',
'nextDay' => '[ئەتە سائەت] LT',
'nextWeek' => '[كېلەركى] dddd [سائەت] LT',
'lastDay' => '[تۆنۈگۈن] LT',
'lastWeek' => '[ئالدىنقى] dddd [سائەت] LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'd':
case 'D':
case 'DDD':
return $number.'-كۈنى';
case 'w':
case 'W':
return $number.'-ھەپتە';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
$time = $hour * 100 + $minute;
if ($time < 600) {
return 'يېرىم كېچە';
}
if ($time < 900) {
return 'سەھەر';
}
if ($time < 1130) {
return 'چۈشتىن بۇرۇن';
}
if ($time < 1230) {
return 'چۈش';
}
if ($time < 1800) {
return 'چۈشتىن كېيىن';
}
return 'كەچ';
},
'months' => ['يانۋار', 'فېۋرال', 'مارت', 'ئاپرېل', 'ماي', 'ئىيۇن', 'ئىيۇل', 'ئاۋغۇست', 'سېنتەبىر', 'ئۆكتەبىر', 'نويابىر', 'دېكابىر'],
'months_short' => ['يانۋار', 'فېۋرال', 'مارت', 'ئاپرېل', 'ماي', 'ئىيۇن', 'ئىيۇل', 'ئاۋغۇست', 'سېنتەبىر', 'ئۆكتەبىر', 'نويابىر', 'دېكابىر'],
'weekdays' => ['يەكشەنبە', 'دۈشەنبە', 'سەيشەنبە', 'چارشەنبە', 'پەيشەنبە', 'جۈمە', 'شەنبە'],
'weekdays_short' => ['يە', 'دۈ', 'سە', 'چا', 'پە', 'جۈ', 'شە'],
'weekdays_min' => ['يە', 'دۈ', 'سە', 'چا', 'پە', 'جۈ', 'شە'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/uk.php 0000644 00000011661 15014555553 0010565 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$processHoursFunction = function (\Carbon\CarbonInterface $date, string $format) {
return $format.'о'.($date->hour === 11 ? 'б' : '').'] LT';
};
return [
'year' => ':count рік|:count роки|:count років',
'y' => ':count рік|:count роки|:count років',
'month' => ':count місяць|:count місяці|:count місяців',
'm' => ':count місяць|:count місяці|:count місяців',
'week' => ':count тиждень|:count тижні|:count тижнів',
'w' => ':count тиждень|:count тижні|:count тижнів',
'day' => ':count день|:count дні|:count днів',
'd' => ':count день|:count дні|:count днів',
'hour' => ':count година|:count години|:count годин',
'h' => ':count година|:count години|:count годин',
'minute' => ':count хвилину|:count хвилини|:count хвилин',
'min' => ':count хвилину|:count хвилини|:count хвилин',
'second' => ':count секунду|:count секунди|:count секунд',
's' => ':count секунду|:count секунди|:count секунд',
'ago' => ':time тому',
'from_now' => 'за :time',
'after' => ':time після',
'before' => ':time до',
'diff_now' => 'щойно',
'diff_yesterday' => 'вчора',
'diff_tomorrow' => 'завтра',
'diff_before_yesterday' => 'позавчора',
'diff_after_tomorrow' => 'післязавтра',
'period_recurrences' => 'один раз|:count рази|:count разів',
'period_interval' => 'кожні :interval',
'period_start_date' => 'з :date',
'period_end_date' => 'до :date',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD.MM.YYYY',
'LL' => 'D MMMM YYYY р.',
'LLL' => 'D MMMM YYYY р., HH:mm',
'LLLL' => 'dddd, D MMMM YYYY р., HH:mm',
],
'calendar' => [
'sameDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
return $processHoursFunction($date, '[Сьогодні ');
},
'nextDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
return $processHoursFunction($date, '[Завтра ');
},
'nextWeek' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
return $processHoursFunction($date, '[У] dddd [');
},
'lastDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
return $processHoursFunction($date, '[Вчора ');
},
'lastWeek' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
switch ($date->dayOfWeek) {
case 0:
case 3:
case 5:
case 6:
return $processHoursFunction($date, '[Минулої] dddd [');
default:
return $processHoursFunction($date, '[Минулого] dddd [');
}
},
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'M':
case 'd':
case 'DDD':
case 'w':
case 'W':
return $number.'-й';
case 'D':
return $number.'-го';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
if ($hour < 4) {
return 'ночі';
}
if ($hour < 12) {
return 'ранку';
}
if ($hour < 17) {
return 'дня';
}
return 'вечора';
},
'months' => ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'],
'months_standalone' => ['січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'],
'months_short' => ['січ', 'лют', 'бер', 'квіт', 'трав', 'черв', 'лип', 'серп', 'вер', 'жовт', 'лист', 'груд'],
'weekdays' => ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'],
'weekdays_short' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
'weekdays_min' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/ur.php 0000644 00000003555 15014555553 0010577 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$months = [
'جنوری',
'فروری',
'مارچ',
'اپریل',
'مئی',
'جون',
'جولائی',
'اگست',
'ستمبر',
'اکتوبر',
'نومبر',
'دسمبر',
];
$weekdays = [
'اتوار',
'پیر',
'منگل',
'بدھ',
'جمعرات',
'جمعہ',
'ہفتہ',
];
return [
'year' => 'ایک سال|:count سال',
'month' => 'ایک ماہ|:count ماہ',
'week' => ':count ہفتے',
'day' => 'ایک دن|:count دن',
'hour' => 'ایک گھنٹہ|:count گھنٹے',
'minute' => 'ایک منٹ|:count منٹ',
'second' => 'چند سیکنڈ|:count سیکنڈ',
'ago' => ':time قبل',
'from_now' => ':time بعد',
'after' => ':time بعد',
'before' => ':time پہلے',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'dddd، D MMMM YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[آج بوقت] LT',
'nextDay' => '[کل بوقت] LT',
'nextWeek' => 'dddd [بوقت] LT',
'lastDay' => '[گذشتہ روز بوقت] LT',
'lastWeek' => '[گذشتہ] dddd [بوقت] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
return $hour < 12 ? 'صبح' : 'شام';
},
'months' => $months,
'months_short' => $months,
'weekdays' => $weekdays,
'weekdays_short' => $weekdays,
'weekdays_min' => $weekdays,
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/uz.php 0000644 00000004544 15014555553 0010606 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'uz');
return [
'year' => 'бир йил|:count йил',
'y' => ':count yil',
'month' => 'бир ой|:count ой',
'm' => ':count oy',
'week' => 'бир ҳафта|:count ҳафта',
'w' => ':count ҳафта',
'day' => 'бир кун|:count кун',
'd' => ':count kun',
'hour' => 'бир соат|:count соат',
'h' => ':count soat',
'minute' => 'бир дакика|:count дакика',
'min' => ':count daq',
'second' => 'фурсат|:count фурсат',
's' => ':count s',
'ago' => 'Бир неча :time олдин',
'from_now' => 'Якин :time ичида',
'after' => ':time keyin',
'before' => ':time oldin',
'diff_yesterday' => 'Кеча',
'diff_tomorrow' => 'Эртага',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'D MMMM YYYY, dddd HH:mm',
],
'calendar' => [
'sameDay' => '[Бугун соат] LT [да]',
'nextDay' => '[Эртага] LT [да]',
'nextWeek' => 'dddd [куни соат] LT [да]',
'lastDay' => '[Кеча соат] LT [да]',
'lastWeek' => '[Утган] dddd [куни соат] LT [да]',
'sameElse' => 'L',
],
'months' => ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'],
'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'],
'weekdays' => ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'],
'weekdays_short' => ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'],
'weekdays_min' => ['Як', 'Ду', 'Се', 'Чо', 'Па', 'Жу', 'Ша'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/uz_Latn.php 0000644 00000003473 15014555553 0011564 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'uz');
return [
'year' => 'bir yil|:count yil',
'month' => 'bir oy|:count oy',
'week' => 'bir hafta|:count hafta',
'day' => 'bir kun|:count kun',
'hour' => 'bir soat|:count soat',
'minute' => 'bir daqiqa|:count daqiqa',
'second' => 'soniya|:count soniya',
'ago' => 'Bir necha :time oldin',
'from_now' => 'Yaqin :time ichida',
'diff_yesterday' => 'Kecha',
'diff_tomorrow' => 'Ertaga',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY HH:mm',
'LLLL' => 'D MMMM YYYY, dddd HH:mm',
],
'calendar' => [
'sameDay' => '[Bugun soat] LT [da]',
'nextDay' => '[Ertaga] LT [da]',
'nextWeek' => 'dddd [kuni soat] LT [da]',
'lastDay' => '[Kecha soat] LT [da]',
'lastWeek' => '[O\'tgan] dddd [kuni soat] LT [da]',
'sameElse' => 'L',
],
'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr'],
'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyun', 'Iyul', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'],
'weekdays' => ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba'],
'weekdays_short' => ['Yak', 'Dush', 'Sesh', 'Chor', 'Pay', 'Jum', 'Shan'],
'weekdays_min' => ['Ya', 'Du', 'Se', 'Cho', 'Pa', 'Ju', 'Sha'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
];
src/Carbon/Lang/vi.php 0000644 00000004307 15014555553 0010563 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => '{1}một năm|]1, Inf[:count năm',
'y' => ':count năm',
'month' => '{1}một tháng|]1, Inf[:count tháng',
'm' => ':count tháng',
'week' => '{1}một tuần|]1, Inf[:count tuần',
'w' => ':count tuần',
'day' => '{1}một ngày|]1, Inf[:count ngày',
'd' => ':count ngày',
'hour' => '{1}một giờ|]1, Inf[:count giờ',
'h' => ':count giờ',
'minute' => '{1}một phút|]1, Inf[:count phút',
'min' => ':count phút',
'second' => '{1}vài giây|]1, Inf[:count giây',
's' => ':count giây',
'ago' => ':time trước',
'from_now' => ':time tới',
'after' => ':time sau',
'before' => ':time trước',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM [năm] YYYY',
'LLL' => 'D MMMM [năm] YYYY HH:mm',
'LLLL' => 'dddd, D MMMM [năm] YYYY HH:mm',
],
'calendar' => [
'sameDay' => '[Hôm nay lúc] LT',
'nextDay' => '[Ngày mai lúc] LT',
'nextWeek' => 'dddd [tuần tới lúc] LT',
'lastDay' => '[Hôm qua lúc] LT',
'lastWeek' => 'dddd [tuần rồi lúc] LT',
'sameElse' => 'L',
],
'meridiem' => function ($hour, $minute, $isLower) {
$meridiem = $hour < 12 ? 'SA' : 'CH';
return $isLower ? strtolower($meridiem) : $meridiem;
},
'months' => ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'],
'months_short' => ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'],
'weekdays' => ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'],
'weekdays_short' => ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
'weekdays_min' => ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/yo.php 0000644 00000004047 15014555553 0010575 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
\Symfony\Component\Translation\PluralizationRules::set(function ($number) {
return $number === 1 ? 0 : 1;
}, 'yo');
return [
'year' => 'ọdún kan|ọdún :count',
'month' => 'osù kan|osù :count',
'week' => 'ọsẹ kan|ọsẹ :count',
'day' => 'ọjọ́ kan|ọjọ́ :count',
'hour' => 'wákati kan|wákati :count',
'minute' => 'ìsẹjú kan|ìsẹjú :count',
'second' => 'ìsẹjú aayá die|aayá :count',
'ago' => ':time kọjá',
'from_now' => 'ní :time',
'diff_yesterday' => 'Àna',
'diff_tomorrow' => 'Ọ̀la',
'formats' => [
'LT' => 'h:mm A',
'LTS' => 'h:mm:ss A',
'L' => 'DD/MM/YYYY',
'LL' => 'D MMMM YYYY',
'LLL' => 'D MMMM YYYY h:mm A',
'LLLL' => 'dddd, D MMMM YYYY h:mm A',
],
'calendar' => [
'sameDay' => '[Ònì ni] LT',
'nextDay' => '[Ọ̀la ni] LT',
'nextWeek' => 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT',
'lastDay' => '[Àna ni] LT',
'lastWeek' => 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
'sameElse' => 'L',
],
'ordinal' => 'ọjọ́ :number',
'months' => ['Sẹ́rẹ́', 'Èrèlè', 'Ẹrẹ̀nà', 'Ìgbé', 'Èbibi', 'Òkùdu', 'Agẹmo', 'Ògún', 'Owewe', 'Ọ̀wàrà', 'Bélú', 'Ọ̀pẹ̀̀'],
'months_short' => ['Sẹ́r', 'Èrl', 'Ẹrn', 'Ìgb', 'Èbi', 'Òkù', 'Agẹ', 'Ògú', 'Owe', 'Ọ̀wà', 'Bél', 'Ọ̀pẹ̀̀'],
'weekdays' => ['Àìkú', 'Ajé', 'Ìsẹ́gun', 'Ọjọ́rú', 'Ọjọ́bọ', 'Ẹtì', 'Àbámẹ́ta'],
'weekdays_short' => ['Àìk', 'Ajé', 'Ìsẹ́', 'Ọjr', 'Ọjb', 'Ẹtì', 'Àbá'],
'weekdays_min' => ['Àì', 'Aj', 'Ìs', 'Ọr', 'Ọb', 'Ẹt', 'Àb'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/zh.php 0000644 00000005276 15014555553 0010574 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count年',
'y' => ':count年',
'month' => ':count个月',
'm' => ':count个月',
'week' => ':count周',
'w' => ':count周',
'day' => ':count天',
'd' => ':count天',
'hour' => ':count小时',
'h' => ':count小时',
'minute' => ':count分钟',
'min' => ':count分钟',
'second' => ':count秒',
's' => ':count秒',
'ago' => ':time前',
'from_now' => '距现在:time',
'after' => ':time后',
'before' => ':time前',
'diff_yesterday' => '昨天',
'diff_tomorrow' => '明天',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY/MM/DD',
'LL' => 'YYYY年M月D日',
'LLL' => 'YYYY年M月D日Ah点mm分',
'LLLL' => 'YYYY年M月D日ddddAh点mm分',
],
'calendar' => [
'sameDay' => '[今天]LT',
'nextDay' => '[明天]LT',
'nextWeek' => '[下]ddddLT',
'lastDay' => '[昨天]LT',
'lastWeek' => '[上]ddddLT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'd':
case 'D':
case 'DDD':
return $number.'日';
case 'M':
return $number.'月';
case 'w':
case 'W':
return $number.'周';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
$time = $hour * 100 + $minute;
if ($time < 600) {
return '凌晨';
}
if ($time < 900) {
return '早上';
}
if ($time < 1130) {
return '上午';
}
if ($time < 1230) {
return '中午';
}
if ($time < 1800) {
return '下午';
}
return '晚上';
},
'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
'weekdays_short' => ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/zh_CN.php 0000644 00000005222 15014555553 0011143 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count年',
'y' => ':count年',
'month' => ':count个月',
'm' => ':count个月',
'week' => ':count周',
'w' => ':count周',
'day' => ':count天',
'd' => ':count天',
'hour' => ':count小时',
'h' => ':count小时',
'minute' => ':count分钟',
'min' => ':count分钟',
'second' => '{1}几秒|]1,Inf[:count秒',
's' => ':count秒',
'ago' => ':time前',
'from_now' => ':time内',
'diff_yesterday' => '昨天',
'diff_tomorrow' => '明天',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY/MM/DD',
'LL' => 'YYYY年M月D日',
'LLL' => 'YYYY年M月D日Ah点mm分',
'LLLL' => 'YYYY年M月D日ddddAh点mm分',
],
'calendar' => [
'sameDay' => '[今天]LT',
'nextDay' => '[明天]LT',
'nextWeek' => '[下]ddddLT',
'lastDay' => '[昨天]LT',
'lastWeek' => '[上]ddddLT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'd':
case 'D':
case 'DDD':
return $number.'日';
case 'M':
return $number.'月';
case 'w':
case 'W':
return $number.'周';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
$time = $hour * 100 + $minute;
if ($time < 600) {
return '凌晨';
}
if ($time < 900) {
return '早上';
}
if ($time < 1130) {
return '上午';
}
if ($time < 1230) {
return '中午';
}
if ($time < 1800) {
return '下午';
}
return '晚上';
},
'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
'weekdays_short' => ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/zh_HK.php 0000644 00000005207 15014555553 0011150 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count年',
'y' => ':count年',
'month' => ':count個月',
'm' => ':count月',
'week' => ':count週',
'w' => ':count週',
'day' => ':count天',
'd' => ':count天',
'hour' => ':count小時',
'h' => ':count小時',
'minute' => ':count分鐘',
'min' => ':count分鐘',
'second' => '{1}幾秒|]1,Inf[:count秒',
's' => ':count秒',
'ago' => ':time前',
'from_now' => ':time內',
'diff_yesterday' => '昨天',
'diff_tomorrow' => '明天',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY/MM/DD',
'LL' => 'YYYY年M月D日',
'LLL' => 'YYYY年M月D日 HH:mm',
'LLLL' => 'YYYY年M月D日dddd HH:mm',
],
'calendar' => [
'sameDay' => '[今天]LT',
'nextDay' => '[明天]LT',
'nextWeek' => '[下]ddddLT',
'lastDay' => '[昨天]LT',
'lastWeek' => '[上]ddddLT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'd':
case 'D':
case 'DDD':
return $number.'日';
case 'M':
return $number.'月';
case 'w':
case 'W':
return $number.'周';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
$time = $hour * 100 + $minute;
if ($time < 600) {
return '凌晨';
}
if ($time < 900) {
return '早上';
}
if ($time < 1130) {
return '上午';
}
if ($time < 1230) {
return '中午';
}
if ($time < 1800) {
return '下午';
}
return '晚上';
},
'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
'weekdays_short' => ['週日', '週一', '週二', '週三', '週四', '週五', '週六'],
'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Lang/zh_TW.php 0000644 00000005303 15014555553 0011175 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'year' => ':count年',
'y' => ':count年',
'month' => ':count個月',
'm' => ':count月',
'week' => ':count週',
'w' => ':count週',
'day' => ':count天',
'd' => ':count天',
'hour' => ':count小時',
'h' => ':count小時',
'minute' => ':count分鐘',
'min' => ':count分鐘',
'second' => '{1}幾秒|]1,Inf[:count秒',
's' => ':count秒',
'ago' => ':time前',
'from_now' => ':time內',
'after' => ':time後',
'before' => ':time前',
'diff_yesterday' => '昨天',
'diff_tomorrow' => '明天',
'formats' => [
'LT' => 'HH:mm',
'LTS' => 'HH:mm:ss',
'L' => 'YYYY/MM/DD',
'LL' => 'YYYY年M月D日',
'LLL' => 'YYYY年M月D日 HH:mm',
'LLLL' => 'YYYY年M月D日dddd HH:mm',
],
'calendar' => [
'sameDay' => '[今天] LT',
'nextDay' => '[明天] LT',
'nextWeek' => '[下]dddd LT',
'lastDay' => '[昨天] LT',
'lastWeek' => '[上]dddd LT',
'sameElse' => 'L',
],
'ordinal' => function ($number, $period) {
switch ($period) {
case 'd':
case 'D':
case 'DDD':
return $number.'日';
case 'M':
return $number.'月';
case 'w':
case 'W':
return $number.'周';
default:
return $number;
}
},
'meridiem' => function ($hour, $minute, $isLower) {
$time = $hour * 100 + $minute;
if ($time < 600) {
return '凌晨';
}
if ($time < 900) {
return '早上';
}
if ($time < 1130) {
return '上午';
}
if ($time < 1230) {
return '中午';
}
if ($time < 1800) {
return '下午';
}
return '晚上';
},
'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
'weekdays_short' => ['週日', '週一', '週二', '週三', '週四', '週五', '週六'],
'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
];
src/Carbon/Laravel/ServiceProvider.php 0000644 00000002160 15014555553 0013760 0 ustar 00 app['events'];
if ($events instanceof EventDispatcher || $events instanceof Dispatcher) {
$events->listen(class_exists('Illuminate\Foundation\Events\LocaleUpdated') ? 'Illuminate\Foundation\Events\LocaleUpdated' : 'locale.changed', function () use ($service) {
$service->updateLocale();
});
$service->updateLocale();
}
}
public function updateLocale()
{
$translator = $this->app['translator'];
if ($translator instanceof Translator || $translator instanceof IlluminateTranslator) {
Carbon::setLocale($translator->getLocale());
}
}
public function register()
{
// Needed for Laravel < 5.3 compatibility
}
}
src/Carbon/Traits/Boundaries.php 0000644 00000017770 15014555553 0012635 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use InvalidArgumentException;
/**
* Trait Boundaries.
*
* startOf, endOf and derived method for each unit.
*
* Depends on the following properties:
*
* @property int $year
* @property int $month
* @property int $daysInMonth
* @property int $quarter
*
* Depends on the following methods:
*
* @method $this setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0)
* @method $this setDate(int $year, int $month, int $day)
* @method $this addMonths(int $value = 1)
*/
trait Boundaries
{
/**
* Resets the time to 00:00:00 start of day
*
* @return static
*/
public function startOfDay()
{
return $this->setTime(0, 0, 0, 0);
}
/**
* Resets the time to 23:59:59 end of day
*
* @return static
*/
public function endOfDay()
{
return $this->setTime(static::HOURS_PER_DAY - 1, static::MINUTES_PER_HOUR - 1, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1);
}
/**
* Resets the date to the first day of the month and the time to 00:00:00
*
* @return static
*/
public function startOfMonth()
{
return $this->setDate($this->year, $this->month, 1)->startOfDay();
}
/**
* Resets the date to end of the month and time to 23:59:59
*
* @return static
*/
public function endOfMonth()
{
return $this->setDate($this->year, $this->month, $this->daysInMonth)->endOfDay();
}
/**
* Resets the date to the first day of the quarter and the time to 00:00:00
*
* @return static
*/
public function startOfQuarter()
{
$month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1;
return $this->setDate($this->year, $month, 1)->startOfDay();
}
/**
* Resets the date to end of the quarter and time to 23:59:59
*
* @return static
*/
public function endOfQuarter()
{
return $this->startOfQuarter()->addMonths(static::MONTHS_PER_QUARTER - 1)->endOfMonth();
}
/**
* Resets the date to the first day of the year and the time to 00:00:00
*
* @return static
*/
public function startOfYear()
{
return $this->setDate($this->year, 1, 1)->startOfDay();
}
/**
* Resets the date to end of the year and time to 23:59:59
*
* @return static
*/
public function endOfYear()
{
return $this->setDate($this->year, 12, 31)->endOfDay();
}
/**
* Resets the date to the first day of the decade and the time to 00:00:00
*
* @return static
*/
public function startOfDecade()
{
$year = $this->year - $this->year % static::YEARS_PER_DECADE;
return $this->setDate($year, 1, 1)->startOfDay();
}
/**
* Resets the date to end of the decade and time to 23:59:59
*
* @return static
*/
public function endOfDecade()
{
$year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1;
return $this->setDate($year, 12, 31)->endOfDay();
}
/**
* Resets the date to the first day of the century and the time to 00:00:00
*
* @return static
*/
public function startOfCentury()
{
$year = $this->year - ($this->year - 1) % static::YEARS_PER_CENTURY;
return $this->setDate($year, 1, 1)->startOfDay();
}
/**
* Resets the date to end of the century and time to 23:59:59
*
* @return static
*/
public function endOfCentury()
{
$year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY;
return $this->setDate($year, 12, 31)->endOfDay();
}
/**
* Resets the date to the first day of the century and the time to 00:00:00
*
* @return static
*/
public function startOfMillennium()
{
$year = $this->year - ($this->year - 1) % static::YEARS_PER_MILLENNIUM;
return $this->setDate($year, 1, 1)->startOfDay();
}
/**
* Resets the date to end of the century and time to 23:59:59
*
* @return static
*/
public function endOfMillennium()
{
$year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_MILLENNIUM + static::YEARS_PER_MILLENNIUM;
return $this->setDate($year, 12, 31)->endOfDay();
}
/**
* Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
*
* @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week
*
* @return static
*/
public function startOfWeek($weekStartsAt = null)
{
$date = $this;
while ($date->dayOfWeek !== ($weekStartsAt ?? $this->firstWeekDay)) {
$date = $date->subDay();
}
return $date->startOfDay();
}
/**
* Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59
*
* @param int $weekEndsAt optional start allow you to specify the day of week to use to end the week
*
* @return static
*/
public function endOfWeek($weekEndsAt = null)
{
$date = $this;
while ($date->dayOfWeek !== ($weekEndsAt ?? $this->lastWeekDay)) {
$date = $date->addDay();
}
return $date->endOfDay();
}
/**
* Modify to start of current hour, minutes and seconds become 0
*
* @return static
*/
public function startOfHour()
{
return $this->setTime($this->hour, 0, 0, 0);
}
/**
* Modify to end of current hour, minutes and seconds become 59
*
* @return static
*/
public function endOfHour()
{
return $this->setTime($this->hour, static::MINUTES_PER_HOUR - 1, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1);
}
/**
* Modify to start of current minute, seconds become 0
*
* @return static
*/
public function startOfMinute()
{
return $this->setTime($this->hour, $this->minute, 0, 0);
}
/**
* Modify to end of current minute, seconds become 59
*
* @return static
*/
public function endOfMinute()
{
return $this->setTime($this->hour, $this->minute, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1);
}
/**
* Modify to start of current second, microseconds become 0
*
* @return static
*/
public function startOfSecond()
{
return $this->setTime($this->hour, $this->minute, $this->second, 0);
}
/**
* Modify to end of current second, microseconds become 999999
*
* @return static
*/
public function endOfSecond()
{
return $this->setTime($this->hour, $this->minute, $this->second, static::MICROSECONDS_PER_SECOND - 1);
}
/**
* Modify to start of current given unit.
*
* @param string $unit
* @param array $params
*
* @return static
*/
public function startOf($unit, ...$params)
{
$ucfUnit = ucfirst(static::singularUnit($unit));
$method = "startOf$ucfUnit";
if (!method_exists($this, $method)) {
throw new InvalidArgumentException("Unknown unit '$unit'");
}
return $this->$method(...$params);
}
/**
* Modify to end of current given unit.
*
* @param string $unit
* @param array $params
*
* @return static
*/
public function endOf($unit, ...$params)
{
$ucfUnit = ucfirst(static::singularUnit($unit));
$method = "endOf$ucfUnit";
if (!method_exists($this, $method)) {
throw new InvalidArgumentException("Unknown unit '$unit'");
}
return $this->$method(...$params);
}
}
src/Carbon/Traits/Comparison.php 0000644 00000035406 15014555553 0012650 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\CarbonInterface;
use DateTimeInterface;
use InvalidArgumentException;
/**
* Trait Comparison.
*
* Comparison utils and testers. All the following methods return booleans.
* nowWithSameTz
*
* Depends on the following methods:
*
* @method CarbonInterface nowWithSameTz()
* @method static CarbonInterface yesterday($timezone = null)
* @method static CarbonInterface tomorrow($timezone = null)
*/
trait Comparison
{
/**
* Determines if the instance is equal to another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see equalTo()
*
* @return bool
*/
public function eq($date): bool
{
return $this->equalTo($date);
}
/**
* Determines if the instance is equal to another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @return bool
*/
public function equalTo($date): bool
{
return $this == $date;
}
/**
* Determines if the instance is not equal to another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see notEqualTo()
*
* @return bool
*/
public function ne($date): bool
{
return $this->notEqualTo($date);
}
/**
* Determines if the instance is not equal to another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @return bool
*/
public function notEqualTo($date): bool
{
return !$this->equalTo($date);
}
/**
* Determines if the instance is greater (after) than another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see greaterThan()
*
* @return bool
*/
public function gt($date): bool
{
return $this->greaterThan($date);
}
/**
* Determines if the instance is greater (after) than another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @return bool
*/
public function greaterThan($date): bool
{
return $this > $date;
}
/**
* Determines if the instance is greater (after) than another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see greaterThan()
*
* @return bool
*/
public function isAfter($date): bool
{
return $this->greaterThan($date);
}
/**
* Determines if the instance is greater (after) than or equal to another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see greaterThanOrEqualTo()
*
* @return bool
*/
public function gte($date): bool
{
return $this->greaterThanOrEqualTo($date);
}
/**
* Determines if the instance is greater (after) than or equal to another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @return bool
*/
public function greaterThanOrEqualTo($date): bool
{
return $this >= $date;
}
/**
* Determines if the instance is less (before) than another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see lessThan()
*
* @return bool
*/
public function lt($date): bool
{
return $this->lessThan($date);
}
/**
* Determines if the instance is less (before) than another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @return bool
*/
public function lessThan($date): bool
{
return $this < $date;
}
/**
* Determines if the instance is less (before) than another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see lessThan()
*
* @return bool
*/
public function isBefore($date): bool
{
return $this->lessThan($date);
}
/**
* Determines if the instance is less (before) or equal to another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see lessThanOrEqualTo()
*
* @return bool
*/
public function lte($date): bool
{
return $this->lessThanOrEqualTo($date);
}
/**
* Determines if the instance is less (before) or equal to another
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @return bool
*/
public function lessThanOrEqualTo($date): bool
{
return $this <= $date;
}
/**
* Determines if the instance is between two others
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date1
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date2
* @param bool $equal Indicates if an equal to comparison should be done
*
* @return bool
*/
public function between($date1, $date2, $equal = true): bool
{
if ($date1->greaterThan($date2)) {
$temp = $date1;
$date1 = $date2;
$date2 = $temp;
}
if ($equal) {
return $this->greaterThanOrEqualTo($date1) && $this->lessThanOrEqualTo($date2);
}
return $this->greaterThan($date1) && $this->lessThan($date2);
}
/**
* Determines if the instance is between two others
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date1
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date2
* @param bool $equal Indicates if an equal to comparison should be done
*
* @return bool
*/
public function isBetween($date1, $date2, $equal = true): bool
{
return $this->between($date1, $date2, $equal);
}
/**
* Determines if the instance is a weekday.
*
* @return bool
*/
public function isWeekday()
{
return !$this->isWeekend();
}
/**
* Determines if the instance is a weekend day.
*
* @return bool
*/
public function isWeekend()
{
return in_array($this->dayOfWeek, static::$weekendDays);
}
/**
* Determines if the instance is yesterday.
*
* @return bool
*/
public function isYesterday()
{
return $this->toDateString() === static::yesterday($this->getTimezone())->toDateString();
}
/**
* Determines if the instance is today.
*
* @return bool
*/
public function isToday()
{
return $this->toDateString() === $this->nowWithSameTz()->toDateString();
}
/**
* Determines if the instance is tomorrow.
*
* @return bool
*/
public function isTomorrow()
{
return $this->toDateString() === static::tomorrow($this->getTimezone())->toDateString();
}
/**
* Determines if the instance is in the future, ie. greater (after) than now.
*
* @return bool
*/
public function isFuture()
{
return $this->greaterThan($this->nowWithSameTz());
}
/**
* Determines if the instance is in the past, ie. less (before) than now.
*
* @return bool
*/
public function isPast()
{
return $this->lessThan($this->nowWithSameTz());
}
/**
* Determines if the instance is a leap year.
*
* @return bool
*/
public function isLeapYear()
{
return $this->format('L') === '1';
}
/**
* Determines if the instance is a long year
*
* @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates
*
* @return bool
*/
public function isLongYear()
{
return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53;
}
/**
* Compares the formatted values of the two dates.
*
* @param string $format date formats to compare.
* @param \Carbon\Carbon|\DateTimeInterface|null $date instance to compare with or null to use current day.
*
* @throws \InvalidArgumentException
*
* @return bool
*/
public function isSameAs($format, $date = null)
{
/** @var DateTimeInterface $date */
$date = $date ?: static::now($this->tz);
static::expectDateTime($date, 'null');
/* @var CarbonInterface $this */
return $this->format($format) === $date->format($format);
}
/**
* Determines if the instance is in the current unit given.
*
* @param string $unit singular unit string
* @param \Carbon\Carbon|\DateTimeInterface|null $date instance to compare with or null to use current day.
*
* @throws \InvalidArgumentException
*
* @return bool
*/
public function isSameUnit($unit, $date = null)
{
$units = [
// @call isSameUnit
'year' => 'Y',
// @call isSameUnit
'week' => 'Y-W',
// @call isSameUnit
'day' => 'Y-m-d',
// @call isSameUnit
'hour' => 'Y-m-d H',
// @call isSameUnit
'minute' => 'Y-m-d H:i',
// @call isSameUnit
'second' => 'Y-m-d H:i:s',
// @call isSameUnit
'micro' => 'Y-m-d H:i:s.u',
// @call isSameUnit
'microsecond' => 'Y-m-d H:i:s.u',
];
if (!isset($units[$unit])) {
if (isset($this->$unit)) {
$date = $date ? static::instance($date) : static::now($this->tz);
static::expectDateTime($date);
return $this->$unit === $date->$unit;
}
if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) {
throw new InvalidArgumentException("Bad comparison unit: '$unit'");
}
return false;
}
return $this->isSameAs($units[$unit], $date);
}
/**
* Determines if the instance is in the current unit given.
*
* @param string $unit The unit to test.
*
* @throws \BadMethodCallException
*
* @return bool
*/
public function isCurrentUnit($unit)
{
return $this->{'isSame'.ucfirst($unit)}();
}
/**
* Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).
*
* @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day.
* @param bool $ofSameYear Check if it is the same month in the same year.
*
* @return bool
*/
public function isSameQuarter($date = null, $ofSameYear = true)
{
$date = $date ? static::instance($date) : static::now($this->tz);
static::expectDateTime($date, 'null');
return $this->quarter === $date->quarter && (!$ofSameYear || $this->isSameYear($date));
}
/**
* Checks if the passed in date is in the same month as the instance´s month.
*
* Note that this defaults to only comparing the month while ignoring the year.
* To test if it is the same exact month of the same year, pass in true as the second parameter.
*
* @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date.
* @param bool $ofSameYear Check if it is the same month in the same year.
*
* @return bool
*/
public function isSameMonth($date = null, $ofSameYear = true)
{
return $this->isSameAs($ofSameYear ? 'Y-m' : 'm', $date);
}
/**
* Checks if this day is a specific day of the week.
*
* @param int $dayOfWeek
*
* @return bool
*/
public function isDayOfWeek($dayOfWeek)
{
if (is_string($dayOfWeek) && defined($constant = static::class.'::'.strtoupper($dayOfWeek))) {
$dayOfWeek = constant($constant);
}
return $this->dayOfWeek === $dayOfWeek;
}
/**
* Check if its the birthday. Compares the date/month values of the two dates.
*
* @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day.
*
* @return bool
*/
public function isBirthday($date = null)
{
return $this->isSameAs('md', $date);
}
/**
* Check if today is the last day of the Month
*
* @return bool
*/
public function isLastOfMonth()
{
return $this->day === $this->daysInMonth;
}
/**
* Check if the instance is start of day / midnight.
*
* @param bool $checkMicroseconds check time at microseconds precision
*
* @return bool
*/
public function isStartOfDay($checkMicroseconds = false)
{
/* @var CarbonInterface $this */
return $checkMicroseconds
? $this->format('H:i:s.u') === '00:00:00.000000'
: $this->format('H:i:s') === '00:00:00';
}
/**
* Check if the instance is end of day.
*
* @param bool $checkMicroseconds check time at microseconds precision
*
* @return bool
*/
public function isEndOfDay($checkMicroseconds = false)
{
/* @var CarbonInterface $this */
return $checkMicroseconds
? $this->format('H:i:s.u') === '23:59:59.999999'
: $this->format('H:i:s') === '23:59:59';
}
/**
* Check if the instance is start of day / midnight.
*
* @return bool
*/
public function isMidnight()
{
return $this->isStartOfDay();
}
/**
* Check if the instance is midday.
*
* @return bool
*/
public function isMidday()
{
/* @var CarbonInterface $this */
return $this->format('G:i:s') === static::$midDayAt.':00:00';
}
/**
* Checks if the (date)time string is in a given format.
*
* @param string $date
* @param string $format
*
* @return bool
*/
public static function hasFormat($date, $format)
{
try {
// Try to create a DateTime object. Throws an InvalidArgumentException if the provided time string
// doesn't match the format in any way.
static::createFromFormat($format, $date);
// createFromFormat() is known to handle edge cases silently.
// E.g. "1975-5-1" (Y-n-j) will still be parsed correctly when "Y-m-d" is supplied as the format.
// To ensure we're really testing against our desired format, perform an additional regex validation.
$regex = strtr(
preg_quote($format, '/'),
static::$regexFormats
);
return (bool) preg_match('/^'.$regex.'$/', $date);
} catch (InvalidArgumentException $e) {
}
return false;
}
}
src/Carbon/Traits/Converter.php 0000644 00000020342 15014555553 0012476 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Carbon\CarbonInterface;
use Closure;
use DateTime;
/**
* Trait Converter.
*
* Change date into different string formats and types and
* handle the string cast.
*
* Depends on the following methods:
*
* @method Carbon|CarbonImmutable copy()
* @method string format(string $format)
*/
trait Converter
{
/**
* Format to use for __toString method when type juggling occurs.
*
* @var string|Closure|null
*/
protected static $toStringFormat = null;
/**
* Reset the format used to the default when type juggling a Carbon instance to a string
*
* @return void
*/
public static function resetToStringFormat()
{
static::setToStringFormat(null);
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
* use other method or custom format passed to format() method if you need to dump an other string
* format.
*
* Set the default format used when type juggling a Carbon instance to a string
*
* @param string|Closure|null $format
*
* @return void
*/
public static function setToStringFormat($format)
{
static::$toStringFormat = $format;
}
/**
* Format the instance as a string using the set format
*
* @return string
*/
public function __toString()
{
$format = $this->localToStringFormat ?? static::$toStringFormat;
return $format instanceof Closure
? $format($this)
: $this->format($format ?: (
defined('static::DEFAULT_TO_STRING_FORMAT')
? static::DEFAULT_TO_STRING_FORMAT
: CarbonInterface::DEFAULT_TO_STRING_FORMAT
));
}
/**
* Format the instance as date
*
* @return string
*/
public function toDateString()
{
return $this->format('Y-m-d');
}
/**
* Format the instance as a readable date
*
* @return string
*/
public function toFormattedDateString()
{
return $this->format('M j, Y');
}
/**
* Format the instance as time
*
* @return string
*/
public function toTimeString()
{
return $this->format('H:i:s');
}
/**
* Format the instance as date and time
*
* @return string
*/
public function toDateTimeString()
{
return $this->format('Y-m-d H:i:s');
}
/**
* Format the instance as date and time T-separated with no timezone
*
* @return string
*/
public function toDateTimeLocalString()
{
return $this->format('Y-m-d\TH:i:s');
}
/**
* Format the instance with day, date and time
*
* @return string
*/
public function toDayDateTimeString()
{
return $this->format('D, M j, Y g:i A');
}
/**
* Format the instance as ATOM
*
* @return string
*/
public function toAtomString()
{
return $this->format(DateTime::ATOM);
}
/**
* Format the instance as COOKIE
*
* @return string
*/
public function toCookieString()
{
return $this->format(DateTime::COOKIE);
}
/**
* Format the instance as ISO8601
*
* @return string
*/
public function toIso8601String()
{
return $this->toAtomString();
}
/**
* Format the instance as RFC822
*
* @return string
*/
public function toRfc822String()
{
return $this->format(DateTime::RFC822);
}
/**
* Convert the instance to UTC and return as Zulu ISO8601
*
* @return string
*/
public function toIso8601ZuluString()
{
return $this->copy()->utc()->format('Y-m-d\TH:i:s\Z');
}
/**
* Format the instance as RFC850
*
* @return string
*/
public function toRfc850String()
{
return $this->format(DateTime::RFC850);
}
/**
* Format the instance as RFC1036
*
* @return string
*/
public function toRfc1036String()
{
return $this->format(DateTime::RFC1036);
}
/**
* Format the instance as RFC1123
*
* @return string
*/
public function toRfc1123String()
{
return $this->format(DateTime::RFC1123);
}
/**
* Format the instance as RFC2822
*
* @return string
*/
public function toRfc2822String()
{
return $this->format(DateTime::RFC2822);
}
/**
* Format the instance as RFC3339
*
* @return string
*/
public function toRfc3339String()
{
return $this->format(DateTime::RFC3339);
}
/**
* Format the instance as RSS
*
* @return string
*/
public function toRssString()
{
return $this->format(DateTime::RSS);
}
/**
* Format the instance as W3C
*
* @return string
*/
public function toW3cString()
{
return $this->format(DateTime::W3C);
}
/**
* Format the instance as RFC7231
*
* @return string
*/
public function toRfc7231String()
{
return $this->copy()
->setTimezone('GMT')
->format(defined('static::RFC7231_FORMAT') ? static::RFC7231_FORMAT : CarbonInterface::RFC7231_FORMAT);
}
/**
* Get default array representation.
*
* @return array
*/
public function toArray()
{
return [
'year' => $this->year,
'month' => $this->month,
'day' => $this->day,
'dayOfWeek' => $this->dayOfWeek,
'dayOfYear' => $this->dayOfYear,
'hour' => $this->hour,
'minute' => $this->minute,
'second' => $this->second,
'micro' => $this->micro,
'timestamp' => $this->timestamp,
'formatted' => $this->format(defined('static::DEFAULT_TO_STRING_FORMAT') ? static::DEFAULT_TO_STRING_FORMAT : CarbonInterface::DEFAULT_TO_STRING_FORMAT),
'timezone' => $this->timezone,
];
}
/**
* Get default object representation.
*
* @return object
*/
public function toObject()
{
return (object) $this->toArray();
}
/**
* Returns english human readable complete date string.
*
* @return string
*/
public function toString()
{
return $this->copy()->locale('en')->isoFormat('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
}
/**
* Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept:
* 1977-04-22T01:00:00-05:00).
*
* @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC.
*
* @return null|string
*/
public function toISOString($keepOffset = false)
{
if (!$this->isValid()) {
return null;
}
$keepOffset = (bool) $keepOffset;
$yearFormat = true ? 'YYYY' : 'YYYYYY';
$tzFormat = $keepOffset ? 'Z' : '[Z]';
$date = $keepOffset ? $this : $this->copy()->utc();
return $date->isoFormat("$yearFormat-MM-DD[T]HH:mm:ss.SSSSSS$tzFormat");
}
/**
* Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone.
*
* @return null|string
*/
public function toJSON()
{
return $this->toISOString();
}
/**
* Return native DateTime PHP object matching the current instance.
*
* @return DateTime
*/
public function toDateTime()
{
return new DateTime($this->format('Y-m-d H:i:s.u'), $this->getTimezone());
}
/**
* @alias toDateTime
*
* Return native DateTime PHP object matching the current instance.
*
* @return DateTime
*/
public function toDate()
{
return $this->toDateTime();
}
}
src/Carbon/Traits/Creator.php 0000644 00000036534 15014555553 0012140 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Carbon\Exceptions\InvalidDateException;
use DateTimeInterface;
use InvalidArgumentException;
/**
* Trait Creator.
*
* Static creators.
*
* Depends on the following methods:
*
* @method static Carbon|CarbonImmutable getTestNow()
*/
trait Creator
{
/**
* The errors that can occur.
*
* @var array
*/
protected static $lastErrors;
/**
* Create a new Carbon instance.
*
* Please see the testing aids section (specifically static::setTestNow())
* for more on the possibility of this constructor returning a test instance.
*
* @param string|null $time
* @param \DateTimeZone|string|null $tz
*/
public function __construct($time = null, $tz = null)
{
if (is_int($time)) {
$time = "@$time";
}
// If the class has a test now set and we are trying to create a now()
// instance then override as required
$isNow = empty($time) || $time === 'now';
if (method_exists(static::class, 'hasTestNow') &&
method_exists(static::class, 'getTestNow') &&
static::hasTestNow() &&
($isNow || static::hasRelativeKeywords($time))
) {
/** @var CarbonImmutable|Carbon $testInstance */
$testInstance = clone static::getTestNow();
//shift the time according to the given time zone
if ($tz !== null && $tz !== static::getTestNow()->getTimezone()) {
$testInstance = $testInstance->setTimezone($tz);
} else {
$tz = $testInstance->getTimezone();
}
if (static::hasRelativeKeywords($time)) {
$testInstance = $testInstance->modify($time);
}
$time = $testInstance->format(static::MOCK_DATETIME_FORMAT);
}
$timezone = static::safeCreateDateTimeZone($tz);
// Work-around for PHP bug https://bugs.php.net/bug.php?id=67127
if (strpos((string) .1, '.') === false) {
$locale = setlocale(LC_NUMERIC, '0');
setlocale(LC_NUMERIC, 'C');
}
parent::__construct($time, $timezone);
if (isset($locale)) {
setlocale(LC_NUMERIC, $locale);
}
static::setLastErrors(parent::getLastErrors());
}
/**
* Create a Carbon instance from a DateTime one.
*
* @param \DateTimeInterface $date
*
* @return static
*/
public static function instance($date)
{
if ($date instanceof static) {
return clone $date;
}
static::expectDateTime($date);
return new static($date->format('Y-m-d H:i:s.u'), $date->getTimezone());
}
/**
* Create a carbon instance from a string.
*
* This is an alias for the constructor that allows better fluent syntax
* as it allows you to do Carbon::parse('Monday next week')->fn() rather
* than (new Carbon('Monday next week'))->fn().
*
* @param string|null $time
* @param \DateTimeZone|string|null $tz
*
* @return static
*/
public static function parse($time = null, $tz = null)
{
if ($time instanceof DateTimeInterface) {
return static::instance($time);
}
return new static($time, $tz);
}
/**
* Get a Carbon instance for the current date and time.
*
* @param \DateTimeZone|string|null $tz
*
* @return static
*/
public static function now($tz = null)
{
return new static(null, $tz);
}
/**
* Create a Carbon instance for today.
*
* @param \DateTimeZone|string|null $tz
*
* @return static
*/
public static function today($tz = null)
{
return static::parse('today', $tz);
}
/**
* Create a Carbon instance for tomorrow.
*
* @param \DateTimeZone|string|null $tz
*
* @return static
*/
public static function tomorrow($tz = null)
{
return static::parse('tomorrow', $tz);
}
/**
* Create a Carbon instance for yesterday.
*
* @param \DateTimeZone|string|null $tz
*
* @return static
*/
public static function yesterday($tz = null)
{
return static::parse('yesterday', $tz);
}
/**
* Create a Carbon instance for the greatest supported date.
*
* @return static
*/
public static function maxValue()
{
if (self::$PHPIntSize === 4) {
// 32 bit
return static::createFromTimestamp(PHP_INT_MAX); // @codeCoverageIgnore
}
// 64 bit
return static::create(9999, 12, 31, 23, 59, 59);
}
/**
* Create a Carbon instance for the lowest supported date.
*
* @return static
*/
public static function minValue()
{
if (self::$PHPIntSize === 4) {
// 32 bit
return static::createFromTimestamp(~PHP_INT_MAX); // @codeCoverageIgnore
}
// 64 bit
return static::create(1, 1, 1, 0, 0, 0);
}
/**
* Create a new Carbon instance from a specific date and time.
*
* If any of $year, $month or $day are set to null their now() values will
* be used.
*
* If $hour is null it will be set to its now() value and the default
* values for $minute and $second will be their now() values.
*
* If $hour is not null then the default values for $minute and $second
* will be 0.
*
* @param int|null $year
* @param int|null $month
* @param int|null $day
* @param int|null $hour
* @param int|null $minute
* @param int|null $second
* @param \DateTimeZone|string|null $tz
*
* @throws \InvalidArgumentException
*
* @return static
*/
public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null)
{
if (is_string($year) && !is_numeric($year)) {
return static::parse($year);
}
$defaults = null;
$getDefault = function ($unit) use ($tz, &$defaults) {
if ($defaults === null) {
$now = static::hasTestNow() ? static::getTestNow() : static::now($tz);
$defaults = array_combine([
'year',
'month',
'day',
'hour',
'minute',
'second',
], explode('-', $now->format('Y-n-j-G-i-s.u')));
}
return $defaults[$unit];
};
$year = $year === null ? $getDefault('year') : $year;
$month = $month === null ? $getDefault('month') : $month;
$day = $day === null ? $getDefault('day') : $day;
$hour = $hour === null ? $getDefault('hour') : $hour;
$minute = $minute === null ? $getDefault('minute') : $minute;
$second = $second === null ? $getDefault('second') : $second;
$fixYear = null;
if ($year < 0) {
$fixYear = $year;
$year = 0;
} elseif ($year > 9999) {
$fixYear = $year - 9999;
$year = 9999;
}
$second = ($second < 10 ? '0' : '').number_format($second, 6);
/** @var CarbonImmutable|Carbon $instance */
$instance = static::createFromFormat('!Y-n-j G:i:s.u', sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $tz);
if ($fixYear !== null) {
$instance = $instance->addYears($fixYear);
}
return $instance;
}
/**
* Create a new safe Carbon instance from a specific date and time.
*
* If any of $year, $month or $day are set to null their now() values will
* be used.
*
* If $hour is null it will be set to its now() value and the default
* values for $minute and $second will be their now() values.
*
* If $hour is not null then the default values for $minute and $second
* will be 0.
*
* If one of the set values is not valid, an \InvalidArgumentException
* will be thrown.
*
* @param int|null $year
* @param int|null $month
* @param int|null $day
* @param int|null $hour
* @param int|null $minute
* @param int|null $second
* @param \DateTimeZone|string|null $tz
*
* @throws \Carbon\Exceptions\InvalidDateException|\InvalidArgumentException
*
* @return static|false
*/
public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
{
$fields = static::getRangesByUnit();
foreach ($fields as $field => $range) {
if ($$field !== null && (!is_int($$field) || $$field < $range[0] || $$field > $range[1])) {
if (static::isStrictModeEnabled()) {
throw new InvalidDateException($field, $$field);
}
return false;
}
}
$instance = static::create($year, $month, $day, $hour, $minute, $second, $tz);
foreach (array_reverse($fields) as $field => $range) {
if ($$field !== null && (!is_int($$field) || $$field !== $instance->$field)) {
if (static::isStrictModeEnabled()) {
throw new InvalidDateException($field, $$field);
}
return false;
}
}
return $instance;
}
/**
* Create a Carbon instance from just a date. The time portion is set to now.
*
* @param int|null $year
* @param int|null $month
* @param int|null $day
* @param \DateTimeZone|string|null $tz
*
* @throws \InvalidArgumentException
*
* @return static
*/
public static function createFromDate($year = null, $month = null, $day = null, $tz = null)
{
return static::create($year, $month, $day, null, null, null, $tz);
}
/**
* Create a Carbon instance from just a date. The time portion is set to midnight.
*
* @param int|null $year
* @param int|null $month
* @param int|null $day
* @param \DateTimeZone|string|null $tz
*
* @return static
*/
public static function createMidnightDate($year = null, $month = null, $day = null, $tz = null)
{
return static::create($year, $month, $day, 0, 0, 0, $tz);
}
/**
* Create a Carbon instance from just a time. The date portion is set to today.
*
* @param int|null $hour
* @param int|null $minute
* @param int|null $second
* @param \DateTimeZone|string|null $tz
*
* @throws \InvalidArgumentException
*
* @return static
*/
public static function createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null)
{
return static::create(null, null, null, $hour, $minute, $second, $tz);
}
/**
* Create a Carbon instance from a time string. The date portion is set to today.
*
* @param string $time
* @param \DateTimeZone|string|null $tz
*
* @throws \InvalidArgumentException
*
* @return static
*/
public static function createFromTimeString($time, $tz = null)
{
return static::today($tz)->setTimeFromTimeString($time);
}
private static function createFromFormatAndTimezone($format, $time, $tz)
{
if ($tz === null) {
return parent::createFromFormat($format, $time);
}
$tz = static::safeCreateDateTimeZone($tz);
if ($tz === false) {
return false;
}
return parent::createFromFormat($format, $time, $tz);
}
/**
* Create a Carbon instance from a specific format.
*
* @param string $format Datetime format
* @param string $time
* @param \DateTimeZone|string|false|null $tz
*
* @throws InvalidArgumentException
*
* @return static|false
*/
public static function createFromFormat($format, $time, $tz = null)
{
// First attempt to create an instance, so that error messages are based on the unmodified format.
$date = self::createFromFormatAndTimezone($format, $time, $tz);
$lastErrors = parent::getLastErrors();
if (($mock = static::getTestNow()) && $date instanceof DateTimeInterface) {
// Set timezone from mock if custom timezone was neither given directly nor as a part of format.
// First let's skip the part that will be ignored by the parser.
$nonEscaped = '(?getTimezone();
}
// Prepend mock datetime only if the format does not contain non escaped unix epoch reset flag.
if (!preg_match("/{$nonEscaped}[!|]/", $format)) {
$format = static::MOCK_DATETIME_FORMAT.' '.$format;
$time = $mock->format(static::MOCK_DATETIME_FORMAT).' '.$time;
}
// Regenerate date from the modified format to base result on the mocked instance instead of now.
$date = self::createFromFormatAndTimezone($format, $time, $tz);
}
if ($date instanceof DateTimeInterface) {
$instance = static::instance($date);
$instance::setLastErrors($lastErrors);
return $instance;
}
if (static::isStrictModeEnabled()) {
throw new InvalidArgumentException(implode(PHP_EOL, $lastErrors['errors']));
}
return false;
}
/**
* Make a Carbon instance from given variable if possible.
*
* Always return a new instance. Parse only strings and only these likely to be dates (skip intervals
* and recurrences). Throw an exception for invalid format, but otherwise return null.
*
* @param mixed $var
*
* @return static|null
*/
public static function make($var)
{
if ($var instanceof DateTimeInterface) {
return static::instance($var);
}
$date = null;
if (is_string($var)) {
$var = trim($var);
$first = substr($var, 0, 1);
if (is_string($var) && $first !== 'P' && $first !== 'R' && preg_match('/[a-z0-9]/i', $var)) {
$date = static::parse($var);
}
}
return $date;
}
/**
* Set last errors.
*
* @param array $lastErrors
*
* @return void
*/
private static function setLastErrors(array $lastErrors)
{
static::$lastErrors = $lastErrors;
}
/**
* {@inheritdoc}
*/
public static function getLastErrors()
{
return static::$lastErrors;
}
}
src/Carbon/Traits/Date.php 0000644 00000427127 15014555553 0011420 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use BadMethodCallException;
use Carbon\CarbonInterface;
use Carbon\CarbonTimeZone;
use Closure;
use DateTime;
use DateTimeInterface;
use InvalidArgumentException;
use ReflectionException;
use Symfony\Component\Translation\TranslatorBagInterface;
use Symfony\Component\Translation\TranslatorInterface;
/**
* A simple API extension for DateTime.
*
*
*
* @property int $year
* @property int $yearIso
* @property int $month
* @property int $day
* @property int $hour
* @property int $minute
* @property int $second
* @property int $micro
* @property int $microsecond
* @property int $timestamp seconds since the Unix Epoch
* @property string $englishDayOfWeek the day of week in English
* @property string $shortEnglishDayOfWeek the abbreviated day of week in English
* @property string $englishMonth the day of week in English
* @property string $shortEnglishMonth the abbreviated day of week in English
* @property string $localeDayOfWeek the day of week in current locale LC_TIME
* @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME
* @property string $localeMonth the month in current locale LC_TIME
* @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME
* @property int $milliseconds
* @property int $millisecond
* @property int $milli
* @property int $week 1 through 53
* @property int $isoWeek 1 through 53
* @property int $weekYear year according to week format
* @property int $isoWeekYear year according to ISO week format
* @property int $dayOfYear 1 through 366
* @property int $age does a diffInYears() with default parameters
* @property int $offset the timezone offset in seconds from UTC
* @property int $offsetMinutes the timezone offset in minutes from UTC
* @property int $offsetHours the timezone offset in hours from UTC
* @property CarbonTimeZone $timezone the current timezone
* @property CarbonTimeZone $tz alias of $timezone
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
* @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday)
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
* @property-read int $daysInMonth number of days in the given month
* @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
* @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
* @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language
* @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language
* @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language
* @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
* @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
* @property-read int $noZeroHour current hour from 1 to 24
* @property-read int $weeksInYear 51 through 53
* @property-read int $isoWeeksInYear 51 through 53
* @property-read int $weekOfMonth 1 through 5
* @property-read int $weekNumberInMonth 1 through 5
* @property-read int $firstWeekDay 0 through 6
* @property-read int $lastWeekDay 0 through 6
* @property-read int $daysInYear 365 or 366
* @property-read int $quarter the quarter of this instance, 1 - 4
* @property-read int $decade the decade of this instance
* @property-read int $century the century of this instance
* @property-read int $millennium the millennium of this instance
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
* @property-read string $timezoneName the current timezone name
* @property-read string $tzName alias of $timezoneName
* @property-read string $timezoneAbbreviatedName the current timezone abbreviated name
* @property-read string $tzAbbrName alias of $timezoneAbbreviatedName
* @property-read string $locale locale of the current instance
*
* @method string format($format) call \DateTime::format if mutable or \DateTimeImmutable::format else.
* http://php.net/manual/en/datetime.format.php
* @method static modify($modify) call \DateTime::modify if mutable or \DateTimeImmutable::modify else.
* http://php.net/manual/en/datetime.modify.php
* @method int getOffset() call \DateTime::getOffset if mutable or \DateTimeImmutable::getOffset else.
* http://php.net/manual/en/datetime.getoffset.php
* @method int getTimestamp() call \DateTime::getTimestamp if mutable or \DateTimeImmutable::getTimestamp else.
* http://php.net/manual/en/datetime.gettimestamp.php
* @method static setTime($hour, $minute, $second = 0, $microseconds = 0) call \DateTime::setTime if mutable or \DateTimeImmutable::setTime else.
* http://php.net/manual/en/datetime.settime.php
* @method static setISODate($year, $week, $day = 1) call \DateTime::setISODate if mutable or \DateTimeImmutable::setISODate else.
* http://php.net/manual/en/datetime.setisodate.php
* @method static setTimestamp($unixtimestamp) call \DateTime::setTimestamp if mutable or \DateTimeImmutable::setTimestamp else.
* http://php.net/manual/en/datetime.settimestamp.php
* @method \DateInterval diff($object, $absolute = true) call \DateTime::diff if mutable or \DateTimeImmutable::diff else.
* http://php.net/manual/en/datetime.diff.php
* @method bool isUtc() Check if the current instance has UTC timezone.
* @method bool isUTC() Check if the current instance has UTC timezone.
* @method bool isLocal() Check if the current instance has non-UTC timezone.
* @method bool isValid() Check if the current instance is a valid date.
* @method bool isDST() Check if the current instance is in a daylight saving time.
* @method bool isSunday() Checks if the instance day is sunday.
* @method bool isMonday() Checks if the instance day is monday.
* @method bool isTuesday() Checks if the instance day is tuesday.
* @method bool isWednesday() Checks if the instance day is wednesday.
* @method bool isThursday() Checks if the instance day is thursday.
* @method bool isFriday() Checks if the instance day is friday.
* @method bool isSaturday() Checks if the instance day is saturday.
* @method bool isSameYear(\DateTimeInterface $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentYear() Checks if the instance is in the same year as the current moment.
* @method bool isNextYear() Checks if the instance is in the same year as the current moment next year.
* @method bool isLastYear() Checks if the instance is in the same year as the current moment last year.
* @method bool isSameWeek(\DateTimeInterface $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment.
* @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week.
* @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week.
* @method bool isSameDay(\DateTimeInterface $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentDay() Checks if the instance is in the same day as the current moment.
* @method bool isNextDay() Checks if the instance is in the same day as the current moment next day.
* @method bool isLastDay() Checks if the instance is in the same day as the current moment last day.
* @method bool isSameHour(\DateTimeInterface $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment.
* @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour.
* @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour.
* @method bool isSameMinute(\DateTimeInterface $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment.
* @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute.
* @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute.
* @method bool isSameSecond(\DateTimeInterface $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment.
* @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second.
* @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second.
* @method bool isSameMicro(\DateTimeInterface $date = null) Checks if the given date is in the same micro as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMicro() Checks if the instance is in the same micro as the current moment.
* @method bool isNextMicro() Checks if the instance is in the same micro as the current moment next micro.
* @method bool isLastMicro() Checks if the instance is in the same micro as the current moment last micro.
* @method bool isSameMicrosecond(\DateTimeInterface $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment.
* @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond.
* @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond.
* @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment.
* @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month.
* @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month.
* @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment.
* @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter.
* @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter.
* @method bool isSameDecade(\DateTimeInterface $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment.
* @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade.
* @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade.
* @method bool isSameCentury(\DateTimeInterface $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment.
* @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century.
* @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century.
* @method bool isSameMillennium(\DateTimeInterface $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
* @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment.
* @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium.
* @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium.
* @method $this years(int $value) Set current instance year to the given value.
* @method $this year(int $value) Set current instance year to the given value.
* @method $this setYears(int $value) Set current instance year to the given value.
* @method $this setYear(int $value) Set current instance year to the given value.
* @method $this months(int $value) Set current instance month to the given value.
* @method $this month(int $value) Set current instance month to the given value.
* @method $this setMonths(int $value) Set current instance month to the given value.
* @method $this setMonth(int $value) Set current instance month to the given value.
* @method $this days(int $value) Set current instance day to the given value.
* @method $this day(int $value) Set current instance day to the given value.
* @method $this setDays(int $value) Set current instance day to the given value.
* @method $this setDay(int $value) Set current instance day to the given value.
* @method $this hours(int $value) Set current instance hour to the given value.
* @method $this hour(int $value) Set current instance hour to the given value.
* @method $this setHours(int $value) Set current instance hour to the given value.
* @method $this setHour(int $value) Set current instance hour to the given value.
* @method $this minutes(int $value) Set current instance minute to the given value.
* @method $this minute(int $value) Set current instance minute to the given value.
* @method $this setMinutes(int $value) Set current instance minute to the given value.
* @method $this setMinute(int $value) Set current instance minute to the given value.
* @method $this seconds(int $value) Set current instance second to the given value.
* @method $this second(int $value) Set current instance second to the given value.
* @method $this setSeconds(int $value) Set current instance second to the given value.
* @method $this setSecond(int $value) Set current instance second to the given value.
* @method $this micros(int $value) Set current instance micro to the given value.
* @method $this micro(int $value) Set current instance micro to the given value.
* @method $this setMicros(int $value) Set current instance micro to the given value.
* @method $this setMicro(int $value) Set current instance micro to the given value.
* @method $this microseconds(int $value) Set current instance microsecond to the given value.
* @method $this microsecond(int $value) Set current instance microsecond to the given value.
* @method $this setMicroseconds(int $value) Set current instance microsecond to the given value.
* @method $this setMicrosecond(int $value) Set current instance microsecond to the given value.
* @method $this addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval).
* @method $this addYear() Add one year to the instance (using date interval).
* @method $this subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
* @method $this subYear() Sub one year to the instance (using date interval).
* @method $this addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed.
* @method $this subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed.
* @method $this addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval).
* @method $this addMonth() Add one month to the instance (using date interval).
* @method $this subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval).
* @method $this subMonth() Sub one month to the instance (using date interval).
* @method $this addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval).
* @method $this addDay() Add one day to the instance (using date interval).
* @method $this subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval).
* @method $this subDay() Sub one day to the instance (using date interval).
* @method $this addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval).
* @method $this addHour() Add one hour to the instance (using date interval).
* @method $this subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval).
* @method $this subHour() Sub one hour to the instance (using date interval).
* @method $this addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval).
* @method $this addMinute() Add one minute to the instance (using date interval).
* @method $this subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval).
* @method $this subMinute() Sub one minute to the instance (using date interval).
* @method $this addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval).
* @method $this addSecond() Add one second to the instance (using date interval).
* @method $this subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval).
* @method $this subSecond() Sub one second to the instance (using date interval).
* @method $this addMicros(int $value = 1) Add micros (the $value count passed in) to the instance (using date interval).
* @method $this addMicro() Add one micro to the instance (using date interval).
* @method $this subMicros(int $value = 1) Sub micros (the $value count passed in) to the instance (using date interval).
* @method $this subMicro() Sub one micro to the instance (using date interval).
* @method $this addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
* @method $this addMicrosecond() Add one microsecond to the instance (using date interval).
* @method $this subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
* @method $this subMicrosecond() Sub one microsecond to the instance (using date interval).
* @method $this addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval).
* @method $this addMillennium() Add one millennium to the instance (using date interval).
* @method $this subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval).
* @method $this subMillennium() Sub one millennium to the instance (using date interval).
* @method $this addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
* @method $this addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval).
* @method $this addCentury() Add one century to the instance (using date interval).
* @method $this subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval).
* @method $this subCentury() Sub one century to the instance (using date interval).
* @method $this addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed.
* @method $this subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed.
* @method $this addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval).
* @method $this addDecade() Add one decade to the instance (using date interval).
* @method $this subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval).
* @method $this subDecade() Sub one decade to the instance (using date interval).
* @method $this addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed.
* @method $this subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed.
* @method $this addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval).
* @method $this addQuarter() Add one quarter to the instance (using date interval).
* @method $this subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval).
* @method $this subQuarter() Sub one quarter to the instance (using date interval).
* @method $this addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed.
* @method $this subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
* @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
* @method $this addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
* @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
* @method $this addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval).
* @method $this addWeek() Add one week to the instance (using date interval).
* @method $this subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval).
* @method $this subWeek() Sub one week to the instance (using date interval).
* @method $this addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval).
* @method $this addWeekday() Add one weekday to the instance (using date interval).
* @method $this subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval).
* @method $this subWeekday() Sub one weekday to the instance (using date interval).
* @method $this addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMicrosecond() Add one microsecond to the instance (using timestamp).
* @method $this subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMicrosecond() Sub one microsecond to the instance (using timestamp).
* @method $this addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp).
* @method $this addRealSecond() Add one second to the instance (using timestamp).
* @method $this subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp).
* @method $this subRealSecond() Sub one second to the instance (using timestamp).
* @method $this addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMinute() Add one minute to the instance (using timestamp).
* @method $this subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMinute() Sub one minute to the instance (using timestamp).
* @method $this addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp).
* @method $this addRealHour() Add one hour to the instance (using timestamp).
* @method $this subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp).
* @method $this subRealHour() Sub one hour to the instance (using timestamp).
* @method $this addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp).
* @method $this addRealDay() Add one day to the instance (using timestamp).
* @method $this subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp).
* @method $this subRealDay() Sub one day to the instance (using timestamp).
* @method $this addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp).
* @method $this addRealWeek() Add one week to the instance (using timestamp).
* @method $this subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp).
* @method $this subRealWeek() Sub one week to the instance (using timestamp).
* @method $this addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMonth() Add one month to the instance (using timestamp).
* @method $this subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMonth() Sub one month to the instance (using timestamp).
* @method $this addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp).
* @method $this addRealQuarter() Add one quarter to the instance (using timestamp).
* @method $this subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp).
* @method $this subRealQuarter() Sub one quarter to the instance (using timestamp).
* @method $this addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp).
* @method $this addRealYear() Add one year to the instance (using timestamp).
* @method $this subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp).
* @method $this subRealYear() Sub one year to the instance (using timestamp).
* @method $this addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp).
* @method $this addRealDecade() Add one decade to the instance (using timestamp).
* @method $this subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp).
* @method $this subRealDecade() Sub one decade to the instance (using timestamp).
* @method $this addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp).
* @method $this addRealCentury() Add one century to the instance (using timestamp).
* @method $this subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp).
* @method $this subRealCentury() Sub one century to the instance (using timestamp).
* @method $this addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp).
* @method $this addRealMillennium() Add one millennium to the instance (using timestamp).
* @method $this subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp).
* @method $this subRealMillennium() Sub one millennium to the instance (using timestamp).
* @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
* @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
* @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision.
* @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision.
* @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision.
* @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision.
* @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
* @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
* @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision.
* @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision.
* @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision.
* @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision.
* @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
* @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
* @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision.
* @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision.
* @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision.
* @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision.
* @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
* @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
* @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision.
* @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision.
* @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision.
* @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision.
* @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
* @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
* @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision.
* @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision.
* @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision.
* @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision.
* @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
* @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
* @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision.
* @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision.
* @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision.
* @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision.
* @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
* @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
* @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision.
* @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision.
* @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision.
* @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision.
* @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
* @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
* @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision.
* @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision.
* @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision.
* @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision.
* @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
* @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
* @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision.
* @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision.
* @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision.
* @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision.
* @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
* @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
* @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision.
* @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision.
* @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision.
* @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision.
* @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
* @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
* @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision.
* @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision.
* @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision.
* @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision.
* @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
* @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
* @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision.
* @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision.
* @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision.
* @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision.
* @method string shortAbsoluteDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale.
* @method string shortAbsoluteDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale.
* @method string longAbsoluteDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale.
* @method string longAbsoluteDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale.
* @method string shortRelativeDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale.
* @method string shortRelativeDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale.
* @method string longRelativeDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale.
* @method string longRelativeDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale.
* @method string shortRelativeToNowDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string shortRelativeToNowDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string longRelativeToNowDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string longRelativeToNowDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale.
* @method string shortRelativeToOtherDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string shortRelativeToOtherDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string longRelativeToOtherDiffForHumans(\DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale.
* @method string longRelativeToOtherDiffForHumans(int $parts = 1, \DateTimeInterface $other = null) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale.
*
*
*/
trait Date
{
use Boundaries;
use Comparison;
use Converter;
use Creator;
use Difference;
use Macro;
use Modifiers;
use Mutability;
use Options;
use Rounding;
use Serialization;
use Test;
use Timestamp;
use Units;
use Week;
/**
* Names of days of the week.
*
* @var array
*/
protected static $days = [
// @call isDayOfWeek
self::SUNDAY => 'Sunday',
// @call isDayOfWeek
self::MONDAY => 'Monday',
// @call isDayOfWeek
self::TUESDAY => 'Tuesday',
// @call isDayOfWeek
self::WEDNESDAY => 'Wednesday',
// @call isDayOfWeek
self::THURSDAY => 'Thursday',
// @call isDayOfWeek
self::FRIDAY => 'Friday',
// @call isDayOfWeek
self::SATURDAY => 'Saturday',
];
/**
* Will UTF8 encoding be used to print localized date/time ?
*
* @var bool
*/
protected static $utf8 = false;
/**
* List of unit and magic methods associated as doc-comments.
*
* @var array
*/
protected static $units = [
// @call setUnit
// @call addUnit
'year',
// @call setUnit
// @call addUnit
'month',
// @call setUnit
// @call addUnit
'day',
// @call setUnit
// @call addUnit
'hour',
// @call setUnit
// @call addUnit
'minute',
// @call setUnit
// @call addUnit
'second',
// @call setUnit
// @call addUnit
'micro',
// @call setUnit
// @call addUnit
'microsecond',
];
/**
* Creates a DateTimeZone from a string, DateTimeZone or integer offset.
*
* @param \DateTimeZone|string|int|null $object
*
* @throws \InvalidArgumentException
*
* @return \DateTimeZone|false
*/
protected static function safeCreateDateTimeZone($object)
{
return CarbonTimeZone::instance($object);
}
/**
* Get the TimeZone associated with the Carbon instance (as CarbonTimeZone).
*
* @return CarbonTimeZone
*
* @link http://php.net/manual/en/datetime.gettimezone.php
*/
public function getTimezone()
{
return CarbonTimeZone::instance(parent::getTimezone());
}
/**
* List of minimum and maximums for each unit.
*
* @return array
*/
protected static function getRangesByUnit()
{
return [
// @call roundUnit
'year' => [1, 9999],
// @call roundUnit
'month' => [1, static::MONTHS_PER_YEAR],
// @call roundUnit
'day' => [1, 31],
// @call roundUnit
'hour' => [0, static::HOURS_PER_DAY - 1],
// @call roundUnit
'minute' => [0, static::MINUTES_PER_HOUR - 1],
// @call roundUnit
'second' => [0, static::SECONDS_PER_MINUTE - 1],
];
}
/**
* Get a copy of the instance.
*
* @return static
*/
public function copy()
{
return clone $this;
}
/**
* @alias copy
*
* Get a copy of the instance.
*
* @return static
*/
public function clone()
{
return clone $this;
}
/**
* Returns a present instance in the same timezone.
*
* @return static
*/
public function nowWithSameTz()
{
return static::now($this->getTimezone());
}
/**
* Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface.
*
* @param mixed $date
* @param string|array $other
*
* @throws \InvalidArgumentException
*/
protected static function expectDateTime($date, $other = [])
{
$message = 'Expected ';
foreach ((array) $other as $expect) {
$message .= "$expect, ";
}
if (!$date instanceof DateTime && !$date instanceof DateTimeInterface) {
throw new InvalidArgumentException(
$message.'DateTime or DateTimeInterface, '.
(is_object($date) ? get_class($date) : gettype($date)).' given'
);
}
}
/**
* Return the Carbon instance passed through, a now instance in the same timezone
* if null given or parse the input if string given.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
*
* @return static
*/
protected function resolveCarbon($date = null)
{
if (!$date) {
return $this->nowWithSameTz();
}
if (is_string($date)) {
return static::parse($date, $this->getTimezone());
}
static::expectDateTime($date, ['null', 'string']);
return $date instanceof self ? $date : static::instance($date);
}
///////////////////////////////////////////////////////////////////
///////////////////////// GETTERS AND SETTERS /////////////////////
///////////////////////////////////////////////////////////////////
/**
* Get a part of the Carbon object
*
* @param string $name
*
* @throws InvalidArgumentException|ReflectionException
*
* @return string|int|bool|\DateTimeZone|null
*/
public function __get($name)
{
return $this->get($name);
}
/**
* Get a part of the Carbon object
*
* @param string $name
*
* @throws InvalidArgumentException|ReflectionException
*
* @return string|int|bool|\DateTimeZone|null
*/
public function get($name)
{
static $formats = [
// @property int
'year' => 'Y',
// @property int
'yearIso' => 'o',
// @property int
// @call isSameUnit
'month' => 'n',
// @property int
'day' => 'j',
// @property int
'hour' => 'G',
// @property int
'minute' => 'i',
// @property int
'second' => 's',
// @property int
'micro' => 'u',
// @property int
'microsecond' => 'u',
// @property-read int 0 (for Sunday) through 6 (for Saturday)
'dayOfWeek' => 'w',
// @property-read int 1 (for Monday) through 7 (for Sunday)
'dayOfWeekIso' => 'N',
// @property-read int ISO-8601 week number of year, weeks starting on Monday
'weekOfYear' => 'W',
// @property-read int number of days in the given month
'daysInMonth' => 't',
// @property int seconds since the Unix Epoch
'timestamp' => 'U',
// @property-read string "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
'latinMeridiem' => 'a',
// @property-read string "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
'latinUpperMeridiem' => 'A',
// @property string the day of week in English
'englishDayOfWeek' => 'l',
// @property string the abbreviated day of week in English
'shortEnglishDayOfWeek' => 'D',
// @property string the day of week in English
'englishMonth' => 'F',
// @property string the abbreviated day of week in English
'shortEnglishMonth' => 'M',
// @property string the day of week in current locale LC_TIME
'localeDayOfWeek' => '%A',
// @property string the abbreviated day of week in current locale LC_TIME
'shortLocaleDayOfWeek' => '%a',
// @property string the month in current locale LC_TIME
'localeMonth' => '%B',
// @property string the abbreviated month in current locale LC_TIME
'shortLocaleMonth' => '%b',
];
switch (true) {
case isset($formats[$name]):
$format = $formats[$name];
$method = substr($format, 0, 1) === '%' ? 'formatLocalized' : 'format';
$value = $this->$method($format);
return is_numeric($value) ? (int) $value : $value;
// @property-read string long name of weekday translated according to Carbon locale, in english if no translation available for current language
case $name === 'dayName':
return $this->getTranslationMessage('weekdays.'.$this->dayOfWeek, null, $this->englishDayOfWeek);
// @property-read string short name of weekday translated according to Carbon locale, in english if no translation available for current language
case $name === 'shortDayName':
return $this->getTranslationMessage('weekdays_short.'.$this->dayOfWeek, null, $this->shortEnglishDayOfWeek);
// @property-read string very short name of weekday translated according to Carbon locale, in english if no translation available for current language
case $name === 'minDayName':
return $this->getTranslationMessage('weekdays_min.'.$this->dayOfWeek, null, $this->shortEnglishDayOfWeek);
// @property-read string long name of month translated according to Carbon locale, in english if no translation available for current language
case $name === 'monthName':
return $this->getTranslationMessage('months.'.($this->month - 1), null, $this->englishMonth);
// @property-read string short name of month translated according to Carbon locale, in english if no translation available for current language
case $name === 'shortMonthName':
return $this->getTranslationMessage('months_short.'.($this->month - 1), null, $this->shortEnglishMonth);
// @property-read string lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
case $name === 'meridiem':
$meridiem = $this->translate('meridiem', [
'hour' => $this->hour,
'minute' => $this->minute,
'isLower' => true,
]);
return $meridiem === 'meridiem' ? $this->latinMeridiem : $meridiem;
// @property-read string uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
case $name === 'upperMeridiem':
$meridiem = $this->translate('meridiem', [
'hour' => $this->hour,
'minute' => $this->minute,
'isLower' => false,
]);
return $meridiem === 'meridiem' ? $this->latinUpperMeridiem : $meridiem;
// @property-read int current hour from 1 to 24
case $name === 'noZeroHour':
return $this->hour ?: 24;
// @property int
case $name === 'milliseconds':
// @property int
case $name === 'millisecond':
// @property int
case $name === 'milli':
return (int) floor($this->format('u') / 1000);
// @property int 1 through 53
case $name === 'week':
return (int) $this->week();
// @property int 1 through 53
case $name === 'isoWeek':
return (int) $this->isoWeek();
// @property int year according to week format
case $name === 'weekYear':
return (int) $this->weekYear();
// @property int year according to ISO week format
case $name === 'isoWeekYear':
return (int) $this->isoWeekYear();
// @property-read int 51 through 53
case $name === 'weeksInYear':
return (int) $this->weeksInYear();
// @property-read int 51 through 53
case $name === 'isoWeeksInYear':
return (int) $this->isoWeeksInYear();
// @property-read int 1 through 5
case $name === 'weekOfMonth':
return (int) ceil($this->day / static::DAYS_PER_WEEK);
// @property-read int 1 through 5
case $name === 'weekNumberInMonth':
return (int) ceil(($this->day + $this->copy()->startOfMonth()->dayOfWeekIso - 1) / static::DAYS_PER_WEEK);
// @property-read int 0 through 6
case $name === 'firstWeekDay':
return $this->localTranslator ? ($this->getTranslationMessage('first_day_of_week') ?? 0) : static::getWeekStartsAt();
// @property-read int 0 through 6
case $name === 'lastWeekDay':
return $this->localTranslator ? (($this->getTranslationMessage('first_day_of_week') ?? 0) + static::DAYS_PER_WEEK - 1) % static::DAYS_PER_WEEK : static::getWeekEndsAt();
// @property int 1 through 366
case $name === 'dayOfYear':
return 1 + intval($this->format('z'));
// @property-read int 365 or 366
case $name === 'daysInYear':
return $this->isLeapYear() ? 366 : 365;
// @property int does a diffInYears() with default parameters
case $name === 'age':
return $this->diffInYears();
// @property-read int the quarter of this instance, 1 - 4
// @call isSameUnit
case $name === 'quarter':
return (int) ceil($this->month / static::MONTHS_PER_QUARTER);
// @property-read int the decade of this instance
// @call isSameUnit
case $name === 'decade':
return (int) ceil($this->year / static::YEARS_PER_DECADE);
// @property-read int the century of this instance
// @call isSameUnit
case $name === 'century':
$factor = 1;
$year = $this->year;
if ($year < 0) {
$year = -$year;
$factor = -1;
}
return (int) ($factor * ceil($year / static::YEARS_PER_CENTURY));
// @property-read int the millennium of this instance
// @call isSameUnit
case $name === 'millennium':
$factor = 1;
$year = $this->year;
if ($year < 0) {
$year = -$year;
$factor = -1;
}
return (int) ($factor * ceil($year / static::YEARS_PER_MILLENNIUM));
// @property int the timezone offset in seconds from UTC
case $name === 'offset':
return $this->getOffset();
// @property int the timezone offset in minutes from UTC
case $name === 'offsetMinutes':
return $this->getOffset() / static::SECONDS_PER_MINUTE;
// @property int the timezone offset in hours from UTC
case $name === 'offsetHours':
return $this->getOffset() / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR;
// @property-read bool daylight savings time indicator, true if DST, false otherwise
case $name === 'dst':
return $this->format('I') === '1';
// @property-read bool checks if the timezone is local, true if local, false otherwise
case $name === 'local':
return $this->getOffset() === $this->copy()->setTimezone(date_default_timezone_get())->getOffset();
// @property-read bool checks if the timezone is UTC, true if UTC, false otherwise
case $name === 'utc':
return $this->getOffset() === 0;
// @property CarbonTimeZone $timezone the current timezone
// @property CarbonTimeZone $tz alias of $timezone
case $name === 'timezone' || $name === 'tz':
return CarbonTimeZone::instance($this->getTimezone());
// @property-read string $timezoneName the current timezone name
// @property-read string $tzName alias of $timezoneName
case $name === 'timezoneName' || $name === 'tzName':
return $this->getTimezone()->getName();
// @property-read string $timezoneAbbreviatedName the current timezone abbreviated name
// @property-read string $tzAbbrName alias of $timezoneAbbreviatedName
case $name === 'timezoneAbbreviatedName' || $name === 'tzAbbrName':
return CarbonTimeZone::instance($this->getTimezone())->getAbbr($this->dst);
// @property-read string locale of the current instance
case $name === 'locale':
return $this->getLocalTranslator()->getLocale();
default:
if (static::hasMacro($macro = 'get'.ucfirst($name))) {
return $this->$macro();
}
throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name));
}
}
/**
* Check if an attribute exists on the object
*
* @param string $name
*
* @return bool
*/
public function __isset($name)
{
try {
$this->__get($name);
} catch (InvalidArgumentException | ReflectionException $e) {
return false;
}
return true;
}
/**
* Set a part of the Carbon object
*
* @param string $name
* @param string|int|\DateTimeZone $value
*
* @throws InvalidArgumentException|ReflectionException
*
* @return void
*/
public function __set($name, $value)
{
$this->set($name, $value);
}
/**
* Set a part of the Carbon object
*
* @param string|array $name
* @param string|int|\DateTimeZone $value
*
* @throws InvalidArgumentException|ReflectionException
*
* @return $this
*/
public function set($name, $value = null)
{
if ($this->isImmutable()) {
throw new \RuntimeException(sprintf(
'%s class is immutable.', static::class
));
}
if (is_array($name)) {
foreach ($name as $_name => $value) {
$this->set($_name, $value);
}
return $this;
}
switch ($name) {
case 'milliseconds':
case 'millisecond':
case 'milli':
case 'microseconds':
case 'microsecond':
case 'micro':
if (substr($name, 0, 5) === 'milli') {
$value *= 1000;
}
while ($value < 0) {
$this->subSecond();
$value += static::MICROSECONDS_PER_SECOND;
}
while ($value >= static::MICROSECONDS_PER_SECOND) {
$this->addSecond();
$value -= static::MICROSECONDS_PER_SECOND;
}
$this->modify($this->format('H:i:s.').str_pad(round($value), 6, '0', STR_PAD_LEFT));
break;
case 'year':
case 'month':
case 'day':
case 'hour':
case 'minute':
case 'second':
list($year, $month, $day, $hour, $minute, $second) = explode('-', $this->format('Y-n-j-G-i-s'));
$$name = $value;
$this->setDateTime($year, $month, $day, $hour, $minute, $second);
break;
case 'week':
return $this->week($value);
case 'isoWeek':
return $this->isoWeek($value);
case 'weekYear':
return $this->weekYear($value);
case 'isoWeekYear':
return $this->isoWeekYear($value);
case 'dayOfYear':
return $this->addDays($value - $this->dayOfYear);
case 'timestamp':
parent::setTimestamp($value);
break;
case 'offset':
$this->setTimezone(static::safeCreateDateTimeZone($value / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR));
break;
case 'offsetMinutes':
$this->setTimezone(static::safeCreateDateTimeZone($value / static::MINUTES_PER_HOUR));
break;
case 'offsetHours':
$this->setTimezone(static::safeCreateDateTimeZone($value));
break;
case 'timezone':
case 'tz':
$this->setTimezone($value);
break;
default:
if (static::hasMacro($macro = 'set'.ucfirst($name))) {
$this->$macro($value);
break;
}
if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) {
throw new InvalidArgumentException(sprintf("Unknown setter '%s'", $name));
}
$this->$name = $value;
}
return $this;
}
/**
* Get/set the day of year.
*
* @param int|null $value new value for day of year if using as setter.
*
* @return static|int
*/
public function dayOfYear($value = null)
{
$dayOfYear = $this->dayOfYear;
return is_null($value) ? $dayOfYear : $this->addDays($value - $dayOfYear);
}
/**
* Get/set the weekday from 0 (Sunday) to 6 (Saturday).
*
* @param int|null $value new value for weekday if using as setter.
*
* @return static|int
*/
public function weekday($value = null)
{
$dayOfWeek = ($this->dayOfWeek + 7 - intval($this->getTranslationMessage('first_day_of_week') ?? 0)) % 7;
return is_null($value) ? $dayOfWeek : $this->addDays($value - $dayOfWeek);
}
/**
* Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
*
* @param int|null $value new value for weekday if using as setter.
*
* @return static|int
*/
public function isoWeekday($value = null)
{
$dayOfWeekIso = $this->dayOfWeekIso;
return is_null($value) ? $dayOfWeekIso : $this->addDays($value - $dayOfWeekIso);
}
/**
* Set any unit to a new value without overflowing current other unit given.
*
* @param string $valueUnit unit name to modify
* @param int $value new value for the input unit
* @param string $overflowUnit unit name to not overflow
*
* @return static
*/
public function setUnitNoOverflow($valueUnit, $value, $overflowUnit)
{
try {
$original = $this->copy();
/** @var CarbonInterface $date */
$date = $this->$valueUnit($value);
$end = $original->copy()->endOf($overflowUnit);
$start = $original->copy()->startOf($overflowUnit);
if ($date < $start) {
$date = $date->setDateTimeFrom($start);
} elseif ($date > $end) {
$date = $date->setDateTimeFrom($end);
}
return $date;
} catch (BadMethodCallException | ReflectionException $exception) {
throw new InvalidArgumentException("Unknown unit '$valueUnit'", 0, $exception);
}
}
/**
* Add any unit to a new value without overflowing current other unit given.
*
* @param string $valueUnit unit name to modify
* @param int $value amount to add to the input unit
* @param string $overflowUnit unit name to not overflow
*
* @return static
*/
public function addUnitNoOverflow($valueUnit, $value, $overflowUnit)
{
return $this->setUnitNoOverflow($valueUnit, $this->$valueUnit + $value, $overflowUnit);
}
/**
* Subtract any unit to a new value without overflowing current other unit given.
*
* @param string $valueUnit unit name to modify
* @param int $value amount to subtract to the input unit
* @param string $overflowUnit unit name to not overflow
*
* @return static
*/
public function subUnitNoOverflow($valueUnit, $value, $overflowUnit)
{
return $this->setUnitNoOverflow($valueUnit, $this->$valueUnit - $value, $overflowUnit);
}
/**
* Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
*
* @param int|null $offset
*
* @return int|static
*/
public function utcOffset(int $offset = null)
{
if (func_num_args() < 1) {
return $this->offsetMinutes;
}
return $this->setTimezone(static::safeCreateDateTimeZone($offset / static::MINUTES_PER_HOUR));
}
/**
* Set the date and time all together.
*
* @param int $year
* @param int $month
* @param int $day
* @param int $hour
* @param int $minute
* @param int $second
*
* @return static
*/
public function setDateTime($year, $month, $day, $hour, $minute, $second = 0, $microseconds = 0)
{
return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second, $microseconds);
}
/**
* Set the time by time string.
*
* @param string $time
*
* @return static
*/
public function setTimeFromTimeString($time)
{
if (strpos($time, ':') === false) {
$time .= ':0';
}
return $this->modify($time);
}
/**
* @alias setTimezone
*
* @param \DateTimeZone|string $value
*
* @return static
*/
public function timezone($value)
{
return $this->setTimezone($value);
}
/**
* Set the timezone or returns the timezone name if no arguments passed.
*
* @param \DateTimeZone|string $value
*
* @return CarbonInterface|string
*/
public function tz($value = null)
{
if (func_num_args() < 1) {
return $this->tzName;
}
return $this->setTimezone($value);
}
/**
* Set the instance's timezone from a string or object.
*
* @param \DateTimeZone|string $value
*
* @return static
*/
public function setTimezone($value)
{
/** @var static $date */
$date = parent::setTimezone(static::safeCreateDateTimeZone($value));
// https://bugs.php.net/bug.php?id=72338
// just workaround on this bug
$date->getTimestamp();
return $date;
}
/**
* Set the instance's timezone from a string or object and add/subtract the offset difference.
*
* @param \DateTimeZone|string $value
*
* @return static
*/
public function shiftTimezone($value)
{
$offset = $this->offset;
$date = $this->setTimezone($value);
return $date->addRealSeconds($offset - $date->offset);
}
/**
* Set the instance's timezone to UTC.
*
* @return static
*/
public function utc()
{
return $this->setTimezone('UTC');
}
/**
* Set the year, month, and date for this instance to that of the passed instance.
*
* @param \Carbon\Carbon|\DateTimeInterface $date now if null
*
* @return static
*/
public function setDateFrom($date = null)
{
$date = $this->resolveCarbon($date);
return $this->setDate($date->year, $date->month, $date->day);
}
/**
* Set the hour, minute, second and microseconds for this instance to that of the passed instance.
*
* @param \Carbon\Carbon|\DateTimeInterface $date now if null
*
* @return static
*/
public function setTimeFrom($date = null)
{
$date = $this->resolveCarbon($date);
return $this->setTime($date->hour, $date->minute, $date->second, $date->microsecond);
}
/**
* Set the date and time for this instance to that of the passed instance.
*
* @param \Carbon\Carbon|\DateTimeInterface $date
*
* @return static
*/
public function setDateTimeFrom($date = null)
{
$date = $this->resolveCarbon($date);
return $this->modify($date->format('Y-m-d H:i:s.u'));
}
/**
* Get the days of the week
*
* @return array
*/
public static function getDays()
{
return static::$days;
}
///////////////////////////////////////////////////////////////////
/////////////////////// WEEK SPECIAL DAYS /////////////////////////
///////////////////////////////////////////////////////////////////
/**
* Get the first day of week
*
* @return int
*/
public static function getWeekStartsAt()
{
return static::$weekStartsAt;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the
* 'first_day_of_week' locale setting to change the start of week according to current locale
* selected and implicitly the end of week.
*
* Set the first day of week
*
* @param int $day week start day
*
* @return void
*/
public static function setWeekStartsAt($day)
{
static::$weekStartsAt = max(0, (7 + $day) % 7);
}
/**
* Get the last day of week
*
* @return int
*/
public static function getWeekEndsAt()
{
return static::$weekEndsAt;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek
* or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the
* start of week according to current locale selected and implicitly the end of week.
*
* Set the last day of week
*
* @param int $day
*
* @return void
*/
public static function setWeekEndsAt($day)
{
static::$weekEndsAt = max(0, (7 + $day) % 7);
}
/**
* Get weekend days
*
* @return array
*/
public static function getWeekendDays()
{
return static::$weekendDays;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather consider week-end is always saturday and sunday, and if you have some custom
* week-end days to handle, give to those days an other name and create a macro for them:
*
* ```
* Carbon::macro('isDayOff', function ($date) {
* return $date->isSunday() || $date->isMonday();
* });
* Carbon::macro('isNotDayOff', function ($date) {
* return !$date->isDayOff();
* });
* if ($someDate->isDayOff()) ...
* if ($someDate->isNotDayOff()) ...
* // Add 5 not-off days
* $count = 5;
* while ($someDate->isDayOff() || ($count-- > 0)) {
* $someDate->addDay();
* }
* ```
*
* Set weekend days
*
* @param array $days
*
* @return void
*/
public static function setWeekendDays($days)
{
static::$weekendDays = $days;
}
/**
* Determine if a time string will produce a relative date.
*
* @param string $time
*
* @return bool true if time match a relative date, false if absolute or invalid time string
*/
public static function hasRelativeKeywords($time)
{
if (strtotime($time) === false) {
return false;
}
$date1 = new DateTime('2000-01-01T00:00:00Z');
$date1->modify($time);
$date2 = new DateTime('2001-12-25T00:00:00Z');
$date2->modify($time);
return $date1 != $date2;
}
///////////////////////////////////////////////////////////////////
/////////////////////// STRING FORMATTING /////////////////////////
///////////////////////////////////////////////////////////////////
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use UTF-8 language packages on every machine.
*
* Set if UTF8 will be used for localized date/time.
*
* @param bool $utf8
*/
public static function setUtf8($utf8)
{
static::$utf8 = $utf8;
}
/**
* Format the instance with the current locale. You can set the current
* locale using setlocale() http://php.net/setlocale.
*
* @param string $format
*
* @return string
*/
public function formatLocalized($format)
{
// Check for Windows to find and replace the %e modifier correctly.
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$format = preg_replace('#(?toDateTimeString()));
return static::$utf8 ? utf8_encode($formatted) : $formatted;
}
/**
* Returns raw translation message for a given key.
*
* @param string $key key to find
* @param string|null $locale current locale used if null
* @param string|null $default default value if translation returns the key
*
* @return string
*/
public function getTranslationMessage(string $key, string $locale = null, string $default = null)
{
$translator = $this->getLocalTranslator();
if (!($translator instanceof TranslatorBagInterface && $translator instanceof TranslatorInterface)) {
throw new InvalidArgumentException(
'Translator does not implement '.TranslatorInterface::class.' and '.TranslatorBagInterface::class.'.'
);
}
$result = $translator->getCatalogue($locale ?? $translator->getLocale())->get($key);
return $result === $key ? $default : $result;
}
/**
* Returns list of locale formats for ISO formatting.
*
* @param string|null $locale current locale used if null
*
* @return array
*/
public function getIsoFormats($locale = null)
{
return [
'LT' => $this->getTranslationMessage('formats.LT', $locale, 'h:mm A'),
'LTS' => $this->getTranslationMessage('formats.LTS', $locale, 'h:mm:ss A'),
'L' => $this->getTranslationMessage('formats.L', $locale, 'MM/DD/YYYY'),
'LL' => $this->getTranslationMessage('formats.LL', $locale, 'MMMM D, YYYY'),
'LLL' => $this->getTranslationMessage('formats.LLL', $locale, 'MMMM D, YYYY h:mm A'),
'LLLL' => $this->getTranslationMessage('formats.LLLL', $locale, 'dddd, MMMM D, YYYY h:mm A'),
];
}
/**
* Returns list of calendar formats for ISO formatting.
*
* @param string|null $locale current locale used if null
*
* @return array
*/
public function getCalendarFormats($locale = null)
{
return [
'sameDay' => $this->getTranslationMessage('calendar.sameDay', $locale, '[Today at] LT'),
'nextDay' => $this->getTranslationMessage('calendar.nextDay', $locale, '[Tomorrow at] LT'),
'nextWeek' => $this->getTranslationMessage('calendar.nextWeek', $locale, 'dddd [at] LT'),
'lastDay' => $this->getTranslationMessage('calendar.lastDay', $locale, '[Yesterday at] LT'),
'lastWeek' => $this->getTranslationMessage('calendar.lastWeek', $locale, '[Last] dddd [at] LT'),
'sameElse' => $this->getTranslationMessage('calendar.sameElse', $locale, 'L'),
];
}
/**
* Returns list of locale units for ISO formatting.
*
* @return array
*/
public static function getIsoUnits()
{
static $units = null;
if ($units === null) {
$units = [
'D' => 'day',
'DD' => ['format', ['d']],
'Do' => ['ordinal', ['day', 'D']],
'd' => 'dayOfWeek',
'dd' => 'minDayName',
'ddd' => 'shortDayName',
'dddd' => 'dayName',
'DDD' => 'dayOfYear',
'DDDD' => ['getPaddedUnit', ['dayOfYear', 3]],
'DDDo' => ['ordinal', ['dayOfYear', 'DDD']],
'e' => ['weekday', []],
'E' => 'dayOfWeekIso',
'H' => ['format', ['G']],
'HH' => ['format', ['H']],
'h' => ['format', ['g']],
'hh' => ['format', ['h']],
'k' => 'noZeroHour',
'kk' => ['getPaddedUnit', ['noZeroHour']],
'hmm' => ['format', ['gi']],
'hmmss' => ['format', ['gis']],
'Hmm' => ['format', ['Gi']],
'Hmmss' => ['format', ['Gis']],
'm' => 'minute',
'mm' => ['format', ['i']],
'a' => 'meridiem',
'A' => 'upperMeridiem',
's' => 'second',
'ss' => ['getPaddedUnit', ['second']],
'S' => function (CarbonInterface $date) {
return strval(floor($date->micro / 100000));
},
'SS' => function (CarbonInterface $date) {
return str_pad(floor($date->micro / 10000), 2, '0', STR_PAD_LEFT);
},
'SSS' => function (CarbonInterface $date) {
return str_pad(floor($date->micro / 1000), 3, '0', STR_PAD_LEFT);
},
'SSSS' => function (CarbonInterface $date) {
return str_pad(floor($date->micro / 100), 4, '0', STR_PAD_LEFT);
},
'SSSSS' => function (CarbonInterface $date) {
return str_pad(floor($date->micro / 10), 5, '0', STR_PAD_LEFT);
},
'SSSSSS' => ['getPaddedUnit', ['micro', 6]],
'SSSSSSS' => function (CarbonInterface $date) {
return str_pad(floor($date->micro * 10), 7, '0', STR_PAD_LEFT);
},
'SSSSSSSS' => function (CarbonInterface $date) {
return str_pad(floor($date->micro * 100), 8, '0', STR_PAD_LEFT);
},
'SSSSSSSSS' => function (CarbonInterface $date) {
return str_pad(floor($date->micro * 1000), 9, '0', STR_PAD_LEFT);
},
'M' => 'month',
'MM' => ['format', ['m']],
'MMM' => function (CarbonInterface $date) {
$month = $date->shortMonthName;
$suffix = $date->getTranslationMessage('mmm_suffix');
if ($suffix && $month !== $date->monthName) {
$month .= $suffix;
}
return $month;
},
'MMMM' => 'monthName',
'Mo' => ['ordinal', ['month', 'M']],
'Q' => 'quarter',
'Qo' => ['ordinal', ['quarter', 'M']],
'G' => 'isoWeekYear',
'GG' => ['getPaddedUnit', ['isoWeekYear']],
'GGG' => ['getPaddedUnit', ['isoWeekYear', 3]],
'GGGG' => ['getPaddedUnit', ['isoWeekYear', 4]],
'GGGGG' => ['getPaddedUnit', ['isoWeekYear', 5]],
'g' => 'weekYear',
'gg' => ['getPaddedUnit', ['weekYear']],
'ggg' => ['getPaddedUnit', ['weekYear', 3]],
'gggg' => ['getPaddedUnit', ['weekYear', 4]],
'ggggg' => ['getPaddedUnit', ['weekYear', 5]],
'W' => 'isoWeek',
'WW' => ['getPaddedUnit', ['isoWeek']],
'Wo' => ['ordinal', ['isoWeek', 'W']],
'w' => 'week',
'ww' => ['getPaddedUnit', ['week']],
'wo' => ['ordinal', ['week', 'w']],
'x' => ['valueOf', []],
'X' => 'timestamp',
'Y' => 'year',
'YY' => ['format', ['y']],
'YYYY' => ['getPaddedUnit', ['year', 4]],
'YYYYY' => ['getPaddedUnit', ['year', 5]],
'YYYYYY' => function (CarbonInterface $date) {
return ($date->year < 0 ? '' : '+').$date->getPaddedUnit('year', 6);
},
'z' => 'tzAbbrName',
'zz' => 'tzName',
'Z' => ['getOffsetString', []],
'ZZ' => ['getOffsetString', ['']],
];
}
return $units;
}
/**
* Returns a unit of the instance padded with 0 by default or any other string if specified.
*
* @param string $unit Carbon unit name
* @param int $length Length of the output (2 by default)
* @param string $padString String to use for padding ("0" by default)
* @param int $padType Side(s) to pad (STR_PAD_LEFT by default)
*
* @return string
*/
public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = STR_PAD_LEFT)
{
return ($this->$unit < 0 ? '-' : '').str_pad(abs($this->$unit), $length, $padString, $padType);
}
/**
* Translate using translation string or callback available.
*
* @param string $key
* @param array $parameters
* @param null $number
*
* @return string
*/
public function translate(string $key, array $parameters = [], $number = null): string
{
$message = $this->getTranslationMessage($key, null, $key);
if ($message instanceof Closure) {
return $message(...array_values($parameters));
}
return $number === null
? $this->getLocalTranslator()->trans($key, $parameters)
: $this->getLocalTranslator()->transChoice($key, $number, $parameters);
}
/**
* Return a property with its ordinal.
*
* @param string $key
* @param string|null $period
*
* @return string
*/
public function ordinal(string $key, string $period = null): string
{
$number = $this->$key;
$result = $this->translate('ordinal', [
'number' => $number,
'period' => $period,
]);
return strval($result === 'ordinal' ? $number : $result);
}
/**
* @param string $format
*
* @return string
*/
public function isoFormat(string $format): string
{
$result = '';
$length = mb_strlen($format);
$inEscaped = false;
$formats = null;
$units = null;
for ($i = 0; $i < $length; $i++) {
$char = mb_substr($format, $i, 1);
if ($char === '\\') {
$result .= mb_substr($format, ++$i, 1);
continue;
}
if ($char === '[' && !$inEscaped) {
$inEscaped = true;
continue;
}
if ($char === ']' && $inEscaped) {
$inEscaped = false;
continue;
}
if ($inEscaped) {
$result .= $char;
continue;
}
$input = mb_substr($format, $i);
if (preg_match('/^(LTS|LT|[Ll]{1,4})/', $input, $match)) {
if ($formats === null) {
$formats = $this->getIsoFormats();
}
$code = $match[0];
$sequence = $formats[$code] ?? preg_replace_callback(
'/MMMM|MM|DD|dddd/',
function ($code) {
return mb_substr($code[0], 1);
},
$formats[strtoupper($code)] ?? ''
);
$rest = mb_substr($format, $i + mb_strlen($code));
$format = mb_substr($format, 0, $i).$sequence.$rest;
$length = mb_strlen($format);
$input = $sequence.$rest;
}
if (preg_match('/^([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY?|g{1,5}|G{1,5}|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?)/', $input, $match)) {
$code = $match[0];
if ($units === null) {
$units = static::getIsoUnits();
}
$sequence = $units[$code] ?? '';
if ($sequence instanceof Closure) {
$sequence = $sequence($this);
} elseif (is_array($sequence)) {
try {
$sequence = $this->{$sequence[0]}(...$sequence[1]);
} catch (ReflectionException | InvalidArgumentException | BadMethodCallException $e) {
$sequence = '';
}
} elseif (is_string($sequence)) {
$sequence = $this->$sequence ?? $code;
}
$format = mb_substr($format, 0, $i).$sequence.mb_substr($format, $i + mb_strlen($code));
$i += mb_strlen($sequence) - 1;
$length = mb_strlen($format);
$char = $sequence;
}
$result .= $char;
}
return $result;
}
/**
* Returns the offset hour and minute formatted with +/- and a given separator (":" by default).
* For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first
* argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something
* like "-12:00".
*
* @param string $separator string to place between hours and minutes (":" by default)
*
* @return string
*/
public function getOffsetString($separator = ':')
{
$second = $this->getOffset();
$symbol = $second < 0 ? '-' : '+';
$minute = abs($second) / static::SECONDS_PER_MINUTE;
$hour = str_pad(floor($minute / static::MINUTES_PER_HOUR), 2, '0', STR_PAD_LEFT);
$minute = str_pad($minute % static::MINUTES_PER_HOUR, 2, '0', STR_PAD_LEFT);
return "$symbol$hour$separator$minute";
}
protected static function executeStaticCallable($macro, ...$parameters)
{
if ($macro instanceof Closure) {
return call_user_func_array(Closure::bind($macro, null, get_called_class()), $parameters);
}
return call_user_func_array($macro, $parameters);
}
/**
* Dynamically handle calls to the class.
*
* @param string $method magic method name called
* @param array $parameters parameters list
*
* @throws \BadMethodCallException
*
* @return mixed
*/
public static function __callStatic($method, $parameters)
{
if (!static::hasMacro($method)) {
foreach (static::getGenericMacros() as $callback) {
try {
return static::executeStaticCallable($callback, $method, ...$parameters);
} catch (BadMethodCallException $exception) {
continue;
}
}
if (static::isStrictModeEnabled()) {
throw new BadMethodCallException(sprintf(
'Method %s::%s does not exist.', static::class, $method
));
}
return null;
}
return static::executeStaticCallable(static::$globalMacros[$method], ...$parameters);
}
/**
* Set specified unit to new given value.
*
* @param string $unit year, month, day, hour, minute, second or microsecond
* @param int $value new value for given unit
*
* @return static
*/
public function setUnit($unit, $value = null)
{
$unit = static::singularUnit($unit);
$dateUnits = ['year', 'month', 'day'];
if (in_array($unit, $dateUnits)) {
return $this->setDate(...array_map(function ($name) use ($unit, $value) {
return $name === $unit ? $value : $this->$name;
}, $dateUnits));
}
$units = ['hour', 'minute', 'second', 'micro'];
if ($unit === 'microsecond') {
$unit = 'micro';
}
return $this->setTime(...array_map(function ($name) use ($unit, $value) {
return $name === $unit ? $value : $this->$name;
}, $units));
}
/**
* Returns standardized singular of a given singular/plural unit name (in English).
*
* @param string $unit
*
* @return string
*/
public static function singularUnit(string $unit): string
{
$unit = rtrim(strtolower($unit), 's');
if ($unit === 'centurie') {
return 'century';
}
if ($unit === 'millennia') {
return 'millennium';
}
return $unit;
}
/**
* Returns standardized plural of a given singular/plural unit name (in English).
*
* @param string $unit
*
* @return string
*/
public static function pluralUnit(string $unit): string
{
$unit = rtrim(strtolower($unit), 's');
if ($unit === 'century') {
return 'centuries';
}
if ($unit === 'millennium' || $unit === 'millennia') {
return 'millennia';
}
return "${unit}s";
}
protected function executeCallable($macro, ...$parameters)
{
if ($macro instanceof Closure) {
return call_user_func_array($macro->bindTo($this, static::class), $parameters);
}
return call_user_func_array($macro, $parameters);
}
protected static function getGenericMacros()
{
foreach (static::$globalGenericMacros as $list) {
foreach ($list as $macro) {
yield $macro;
}
}
}
/**
* Dynamically handle calls to the class.
*
* @param string $method magic method name called
* @param array $parameters parameters list
*
* @throws \BadMethodCallException|\ReflectionException
*
* @return mixed
*/
public function __call($method, $parameters)
{
$diffSizes = [
// @mode diffForHumans
'short' => true,
// @mode diffForHumans
'long' => false,
];
$diffSyntaxModes = [
// @call diffForHumans
'Absolute' => CarbonInterface::DIFF_ABSOLUTE,
// @call diffForHumans
'Relative' => CarbonInterface::DIFF_RELATIVE_AUTO,
// @call diffForHumans
'RelativeToNow' => CarbonInterface::DIFF_RELATIVE_TO_NOW,
// @call diffForHumans
'RelativeToOther' => CarbonInterface::DIFF_RELATIVE_TO_OTHER,
];
$sizePattern = implode('|', array_keys($diffSizes));
$syntaxPattern = implode('|', array_keys($diffSyntaxModes));
if (preg_match("/^(?$sizePattern)(?$syntaxPattern)DiffForHumans$/", $method, $match)) {
$dates = array_filter($parameters, function ($parameter) {
return $parameter instanceof DateTimeInterface;
});
$other = null;
if (count($dates)) {
$key = key($dates);
$other = current($dates);
array_splice($parameters, $key, 1);
}
return $this->diffForHumans($other, $diffSyntaxModes[$match['syntax']], $diffSizes[$match['size']], ...$parameters);
}
$action = substr($method, 0, 4);
if ($action !== 'ceil') {
$action = substr($method, 0, 5);
}
if (in_array($action, ['round', 'floor', 'ceil'])) {
return $this->{$action.'Unit'}(substr($method, strlen($action)), ...$parameters);
}
$unit = rtrim($method, 's');
if (substr($unit, 0, 2) === 'is') {
$word = substr($unit, 2);
if (in_array($word, static::$days)) {
return $this->isDayOfWeek($word);
}
switch ($word) {
// @call is Check if the current instance has UTC timezone.
case 'Utc':
// @call is Check if the current instance has UTC timezone.
case 'UTC':
return $this->utc;
// @call is Check if the current instance has non-UTC timezone.
case 'Local':
return $this->local;
// @call is Check if the current instance is a valid date.
case 'Valid':
return $this->year !== 0;
// @call is Check if the current instance is in a daylight saving time.
case 'DST':
return $this->dst;
}
}
$action = substr($unit, 0, 3);
$overflow = null;
if ($action === 'set') {
$unit = strtolower(substr($unit, 3));
}
if (in_array($unit, static::$units)) {
return $this->setUnit($unit, ...$parameters);
}
if ($action === 'add' || $action === 'sub') {
$unit = substr($unit, 3);
if (substr($unit, 0, 4) === 'Real') {
$unit = static::singularUnit(substr($unit, 4));
return $this->{"${action}RealUnit"}($unit, ...$parameters);
}
if (preg_match('/^(Month|Quarter|Year|Decade|Century|Centurie|Millennium|Millennia)s?(No|With|Without|WithNo)Overflow$/', $unit, $match)) {
$unit = $match[1];
$overflow = $match[2] === 'With';
}
$unit = static::singularUnit($unit);
}
if (static::isModifiableUnit($unit)) {
return $this->{"${action}Unit"}($unit, $parameters[0] ?? 1, $overflow);
}
$sixFirstLetters = substr($unit, 0, 6);
$factor = -1;
if ($sixFirstLetters === 'isLast') {
$sixFirstLetters = 'isNext';
$factor = 1;
}
if ($sixFirstLetters === 'isNext') {
$lowerUnit = strtolower(substr($unit, 6));
if (static::isModifiableUnit($lowerUnit)) {
return $this->copy()->addUnit($lowerUnit, $factor, false)->isSameUnit($lowerUnit, ...$parameters);
}
}
if ($sixFirstLetters === 'isSame') {
try {
return $this->isSameUnit(strtolower(substr($unit, 6)), ...$parameters);
} catch (InvalidArgumentException $exception) {
// Try next
}
}
if (substr($unit, 0, 9) === 'isCurrent') {
try {
return $this->isCurrentUnit(strtolower(substr($unit, 9)));
} catch (InvalidArgumentException | BadMethodCallException $exception) {
// Try macros
}
}
if (!static::hasMacro($method)) {
foreach ([$this->localGenericMacros ?: [], static::getGenericMacros()] as $list) {
foreach ($list as $callback) {
try {
return $this->executeCallable($callback, $method, ...$parameters);
} catch (BadMethodCallException $exception) {
continue;
}
}
}
if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) {
throw new BadMethodCallException("Method $method does not exist.");
}
return null;
}
return $this->executeCallable(($this->localMacros ?? [])[$method] ?? static::$globalMacros[$method], ...$parameters);
}
}
src/Carbon/Traits/Difference.php 0000644 00000044773 15014555553 0012577 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\Carbon;
use Carbon\CarbonInterface;
use Carbon\CarbonInterval;
use Carbon\CarbonPeriod;
use Carbon\Translator;
use Closure;
use DateTimeInterface;
/**
* Trait Difference.
*
* Depends on the following methods:
*
* @method \DateInterval diff(\DateTimeInterface $date)
* @method CarbonInterface copy()
* @method static Translator translator()
*/
trait Difference
{
/**
* Get the difference as a CarbonInterval instance
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return CarbonInterval
*/
public function diffAsCarbonInterval($date = null, $absolute = true)
{
return CarbonInterval::instance($this->diff($this->resolveCarbon($date), $absolute));
}
/**
* Get the difference in years
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInYears($date = null, $absolute = true)
{
return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%y');
}
/**
* Get the difference in months
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInMonths($date = null, $absolute = true)
{
$date = $this->resolveCarbon($date);
return $this->diffInYears($date, $absolute) * static::MONTHS_PER_YEAR + (int) $this->diff($date, $absolute)->format('%r%m');
}
/**
* Get the difference in weeks
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInWeeks($date = null, $absolute = true)
{
return (int) ($this->diffInDays($date, $absolute) / static::DAYS_PER_WEEK);
}
/**
* Get the difference in days
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInDays($date = null, $absolute = true)
{
return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%a');
}
/**
* Get the difference in days using a filter closure
*
* @param Closure $callback
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInDaysFiltered(Closure $callback, $date = null, $absolute = true)
{
return $this->diffFiltered(CarbonInterval::day(), $callback, $date, $absolute);
}
/**
* Get the difference in hours using a filter closure
*
* @param Closure $callback
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInHoursFiltered(Closure $callback, $date = null, $absolute = true)
{
return $this->diffFiltered(CarbonInterval::hour(), $callback, $date, $absolute);
}
/**
* Get the difference by the given interval using a filter closure
*
* @param CarbonInterval $ci An interval to traverse by
* @param Closure $callback
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null, $absolute = true)
{
$start = $this;
$end = $this->resolveCarbon($date);
$inverse = false;
if ($end < $start) {
$start = $end;
$end = $this;
$inverse = true;
}
$options = CarbonPeriod::EXCLUDE_END_DATE | ($this->isMutable() ? 0 : CarbonPeriod::IMMUTABLE);
$diff = $ci->toPeriod($start, $end, $options)->filter($callback)->count();
return $inverse && !$absolute ? -$diff : $diff;
}
/**
* Get the difference in weekdays
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInWeekdays($date = null, $absolute = true)
{
return $this->diffInDaysFiltered(function (CarbonInterface $date) {
return $date->isWeekday();
}, $date, $absolute);
}
/**
* Get the difference in weekend days using a filter
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInWeekendDays($date = null, $absolute = true)
{
return $this->diffInDaysFiltered(function (CarbonInterface $date) {
return $date->isWeekend();
}, $date, $absolute);
}
/**
* Get the difference in hours.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInHours($date = null, $absolute = true)
{
return (int) ($this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR);
}
/**
* Get the difference in hours using timestamps.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInRealHours($date = null, $absolute = true)
{
return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR);
}
/**
* Get the difference in minutes.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInMinutes($date = null, $absolute = true)
{
return (int) ($this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE);
}
/**
* Get the difference in minutes using timestamps.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInRealMinutes($date = null, $absolute = true)
{
return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE);
}
/**
* Get the difference in seconds.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInSeconds($date = null, $absolute = true)
{
$diff = $this->diff($this->resolveCarbon($date));
$value = ((($diff->days * static::HOURS_PER_DAY) +
$diff->h) * static::MINUTES_PER_HOUR +
$diff->i) * static::SECONDS_PER_MINUTE +
$diff->s;
return $absolute || !$diff->invert ? $value : -$value;
}
/**
* Get the difference in microseconds.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInMicroseconds($date = null, $absolute = true)
{
$diff = $this->diff($this->resolveCarbon($date));
$value = (int) round((((($diff->days * static::HOURS_PER_DAY) +
$diff->h) * static::MINUTES_PER_HOUR +
$diff->i) * static::SECONDS_PER_MINUTE +
$diff->s) * static::MICROSECONDS_PER_SECOND +
$diff->f);
return $absolute || !$diff->invert ? $value : -$value;
}
/**
* Get the difference in seconds using timestamps.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInRealSeconds($date = null, $absolute = true)
{
/** @var CarbonInterface $date */
$date = $this->resolveCarbon($date);
$value = $date->getTimestamp() - $this->getTimestamp();
return $absolute ? abs($value) : $value;
}
/**
* Get the difference in microseconds using timestamps.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
* @param bool $absolute Get the absolute of the difference
*
* @return int
*/
public function diffInRealMicroseconds($date = null, $absolute = true)
{
/** @var CarbonInterface $date */
$date = $this->resolveCarbon($date);
$value = ($date->timestamp - $this->timestamp) * static::MICROSECONDS_PER_SECOND +
$date->micro - $this->micro;
return $absolute ? abs($value) : $value;
}
/**
* The number of seconds since midnight.
*
* @return int
*/
public function secondsSinceMidnight()
{
return $this->diffInSeconds($this->copy()->startOfDay());
}
/**
* The number of seconds until 23:59:59.
*
* @return int
*/
public function secondsUntilEndOfDay()
{
return $this->diffInSeconds($this->copy()->endOfDay());
}
/**
* Get the difference in a human readable format in the current locale from current instance to an other
* instance given (or now if null given).
*
* When comparing a value in the past to default now:
* 1 hour ago
* 5 months ago
*
* When comparing a value in the future to default now:
* 1 hour from now
* 5 months from now
*
* When comparing a value in the past to another value:
* 1 hour before
* 5 months before
*
* When comparing a value in the future to another value:
* 1 hour after
* 5 months after
*
* @param Carbon|null $other
* @param int $syntax difference modifiers (ago, after, etc) rules
* Possible values:
* - CarbonInterface::DIFF_ABSOLUTE
* - CarbonInterface::DIFF_RELATIVE_AUTO
* - CarbonInterface::DIFF_RELATIVE_TO_NOW
* - CarbonInterface::DIFF_RELATIVE_TO_OTHER
* Default value: CarbonInterface::DIFF_RELATIVE_AUTO
* @param bool $short displays short format of time units
* @param int $parts displays number of parts in the interval
* @param int $options human diff options
*
* @return string
*/
public function diffForHumans($other = null, $syntax = null, $short = false, $parts = 1, $options = null)
{
/* @var CarbonInterface $this */
$syntax = (int) ($syntax === null ? static::DIFF_RELATIVE_AUTO : $syntax);
$syntax = $syntax === static::DIFF_RELATIVE_AUTO && $other === null ? static::DIFF_RELATIVE_TO_NOW : $syntax;
$parts = min(7, max(1, (int) $parts));
if ($other === null) {
$other = $this->nowWithSameTz();
} elseif (!$other instanceof DateTimeInterface) {
$other = static::parse($other);
}
if (is_null($options)) {
$options = $this->localHumanDiffOptions ?? static::getHumanDiffOptions();
}
return $this->diffAsCarbonInterval($other, false)
->setLocalTranslator($this->getLocalTranslator())
->forHumans($syntax, (bool) $short, $parts, $options);
}
/**
* @alias diffForHumans
*
* Get the difference in a human readable format in the current locale from current instance to an other
* instance given (or now if null given).
*/
public function from($other = null, $syntax = null, $short = false, $parts = 1, $options = null)
{
return $this->diffForHumans($other, $syntax, $short, $parts, $options);
}
/**
* @alias diffForHumans
*
* Get the difference in a human readable format in the current locale from current instance to an other
* instance given (or now if null given).
*/
public function since($other = null, $syntax = null, $short = false, $parts = 1, $options = null)
{
return $this->diffForHumans($other, $syntax, $short, $parts, $options);
}
/**
* Get the difference in a human readable format in the current locale from an other
* instance given (or now if null given) to current instance.
*
* When comparing a value in the past to default now:
* 1 hour from now
* 5 months from now
*
* When comparing a value in the future to default now:
* 1 hour ago
* 5 months ago
*
* When comparing a value in the past to another value:
* 1 hour after
* 5 months after
*
* When comparing a value in the future to another value:
* 1 hour before
* 5 months before
*
* @param Carbon|null $other
* @param int $syntax difference modifiers (ago, after, etc) rules
* Possible values:
* - CarbonInterface::DIFF_ABSOLUTE
* - CarbonInterface::DIFF_RELATIVE_AUTO
* - CarbonInterface::DIFF_RELATIVE_TO_NOW
* - CarbonInterface::DIFF_RELATIVE_TO_OTHER
* Default value: CarbonInterface::DIFF_RELATIVE_AUTO
* @param bool $short displays short format of time units
* @param int $parts displays number of parts in the interval
* @param int $options human diff options
*
* @return string
*/
public function to($other = null, $syntax = null, $short = false, $parts = 1, $options = null)
{
if (!$syntax && !$other) {
$syntax = CarbonInterface::DIFF_RELATIVE_TO_NOW;
}
return $this->resolveCarbon($other)->diffForHumans($this, $syntax, $short, $parts, $options);
}
/**
* @alias to
*
* Get the difference in a human readable format in the current locale from an other
* instance given (or now if null given) to current instance.
*/
public function until($other = null, $syntax = null, $short = false, $parts = 1, $options = null)
{
return $this->to($other, $syntax, $short, $parts, $options);
}
/**
* Get the difference in a human readable format in the current locale from current
* instance to now.
*
* @param int $syntax difference modifiers (ago, after, etc) rules
* Possible values:
* - CarbonInterface::DIFF_ABSOLUTE
* - CarbonInterface::DIFF_RELATIVE_AUTO
* - CarbonInterface::DIFF_RELATIVE_TO_NOW
* - CarbonInterface::DIFF_RELATIVE_TO_OTHER
* Default value: CarbonInterface::DIFF_RELATIVE_AUTO
* @param bool $short displays short format of time units
* @param int $parts displays number of parts in the interval
* @param int $options human diff options
*
* @return string
*/
public function fromNow($syntax = null, $short = false, $parts = 1, $options = null)
{
return $this->from(null, $syntax, $short, $parts, $options);
}
/**
* Get the difference in a human readable format in the current locale from an other
* instance given to now
*
* @param int $syntax difference modifiers (ago, after, etc) rules
* Possible values:
* - CarbonInterface::DIFF_ABSOLUTE
* - CarbonInterface::DIFF_RELATIVE_AUTO
* - CarbonInterface::DIFF_RELATIVE_TO_NOW
* - CarbonInterface::DIFF_RELATIVE_TO_OTHER
* Default value: CarbonInterface::DIFF_RELATIVE_AUTO
* @param bool $short displays short format of time units
* @param int $parts displays number of parts in the interval
* @param int $options human diff options
*
* @return string
*/
public function toNow($syntax = null, $short = false, $parts = 1, $options = null)
{
return $this->to(null, $syntax, $short, $parts, $options);
}
public function calendar($referenceTime = null, array $formats = [])
{
/** @var CarbonInterface $current */
$current = $this->copy()->startOfDay();
/** @var CarbonInterface $other */
$other = $this->resolveCarbon($referenceTime)->copy()->setTimezone($this->getTimezone())->startOfDay();
$diff = $other->diffInDays($current, false);
$format = $diff < -6 ? 'sameElse' : (
$diff < -1 ? 'lastWeek' : (
$diff < 0 ? 'lastDay' : (
$diff < 1 ? 'sameDay' : (
$diff < 2 ? 'nextDay' : (
$diff < 7 ? 'nextWeek' : 'sameElse'
)
)
)
)
);
$format = array_merge($this->getCalendarFormats(), $formats)[$format];
if ($format instanceof Closure) {
$format = $format($current, $other) ?? '';
}
return $this->isoFormat(strval($format));
}
}
src/Carbon/Traits/Localization.php 0000644 00000024077 15014555553 0013170 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\CarbonInterface;
use Carbon\Translator;
use Closure;
use Symfony\Component\Translation\TranslatorBagInterface;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Trait Localization.
*
* Embed default and locale translators and translation base methods.
*/
trait Localization
{
/**
* Default translator.
*
* @var \Symfony\Component\Translation\TranslatorInterface
*/
protected static $translator;
/**
* Specific translator of the current instance.
*
* @var \Symfony\Component\Translation\TranslatorInterface
*/
protected $localTranslator;
/**
* Options for diffForHumans().
*
* @var int
*/
protected static $humanDiffOptions = CarbonInterface::NO_ZERO_DIFF;
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @see settings
*
* @param int $humanDiffOptions
*/
public static function setHumanDiffOptions($humanDiffOptions)
{
static::$humanDiffOptions = $humanDiffOptions;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @see settings
*
* @param int $humanDiffOption
*/
public static function enableHumanDiffOption($humanDiffOption)
{
static::$humanDiffOptions = static::getHumanDiffOptions() | $humanDiffOption;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @see settings
*
* @param int $humanDiffOption
*/
public static function disableHumanDiffOption($humanDiffOption)
{
static::$humanDiffOptions = static::getHumanDiffOptions() & ~$humanDiffOption;
}
/**
* @return int
*/
public static function getHumanDiffOptions()
{
return static::$humanDiffOptions;
}
/**
* Initialize the default translator instance if necessary.
*
* @return \Symfony\Component\Translation\TranslatorInterface
*/
protected static function translator()
{
if (static::$translator === null) {
static::$translator = Translator::get();
}
return static::$translator;
}
/**
* Get the default translator instance in use.
*
* @return \Symfony\Component\Translation\TranslatorInterface
*/
public static function getTranslator()
{
return static::translator();
}
/**
* Set the default translator instance to use.
*
* @param \Symfony\Component\Translation\TranslatorInterface $translator
*
* @return void
*/
public static function setTranslator(TranslatorInterface $translator)
{
static::$translator = $translator;
}
/**
* Get the translator of the current instance or the default if none set.
*
* @return \Symfony\Component\Translation\TranslatorInterface
*/
public function getLocalTranslator()
{
return $this->localTranslator ?: static::translator();
}
/**
* Set the translator for the current instance.
*
* @param \Symfony\Component\Translation\TranslatorInterface $translator
*
* @return $this
*/
public function setLocalTranslator(TranslatorInterface $translator)
{
$this->localTranslator = $translator;
return $this;
}
/**
* Get/set the locale for the current instance.
*
* @param string|null $locale
*
* @return $this|string
*/
public function locale(string $locale = null)
{
if ($locale === null) {
return $this->getLocalTranslator()->getLocale();
}
if (!$this->localTranslator || $this->localTranslator->getLocale() !== $locale) {
$this->setLocalTranslator(Translator::get($locale));
}
return $this;
}
/**
* Get the current translator locale.
*
* @return string
*/
public static function getLocale()
{
return static::translator()->getLocale();
}
/**
* Set the current translator locale and indicate if the source locale file exists.
* Pass 'auto' as locale to use closest language from the current LC_TIME locale.
*
* @param string $locale locale ex. en
*
* @return bool
*/
public static function setLocale($locale)
{
return static::translator()->setLocale($locale) !== false;
}
/**
* Set the current locale to the given, execute the passed function, reset the locale to previous one,
* then return the result of the closure (or null if the closure was void).
*
* @param string $locale locale ex. en
* @param callable $func
*
* @return mixed
*/
public static function executeWithLocale($locale, $func)
{
$currentLocale = static::getLocale();
$result = call_user_func($func, static::setLocale($locale) ? static::getLocale() : false, static::translator());
static::setLocale($currentLocale);
return $result;
}
/**
* Returns true if the given locale is internally supported and has short-units support.
* Support is considered enabled if either year, day or hour has a short variant translated.
*
* @param string $locale locale ex. en
*
* @return bool
*/
public static function localeHasShortUnits($locale)
{
return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) {
return $newLocale &&
(
($y = $translator->trans('y')) !== 'y' &&
$y !== $translator->trans('year')
) || (
($y = $translator->trans('d')) !== 'd' &&
$y !== $translator->trans('day')
) || (
($y = $translator->trans('h')) !== 'h' &&
$y !== $translator->trans('hour')
);
});
}
/**
* Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).
* Support is considered enabled if the 4 sentences are translated in the given locale.
*
* @param string $locale locale ex. en
*
* @return bool
*/
public static function localeHasDiffSyntax($locale)
{
return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) {
if (!$newLocale) {
return false;
}
foreach (['ago', 'from_now', 'before', 'after'] as $key) {
if ($translator instanceof TranslatorBagInterface && $translator->getCatalogue($newLocale)->get($key) instanceof Closure) {
continue;
}
if ($translator->trans($key) === $key) {
return false;
}
}
return true;
});
}
/**
* Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).
* Support is considered enabled if the 3 words are translated in the given locale.
*
* @param string $locale locale ex. en
*
* @return bool
*/
public static function localeHasDiffOneDayWords($locale)
{
return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) {
return $newLocale &&
$translator->trans('diff_now') !== 'diff_now' &&
$translator->trans('diff_yesterday') !== 'diff_yesterday' &&
$translator->trans('diff_tomorrow') !== 'diff_tomorrow';
});
}
/**
* Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).
* Support is considered enabled if the 2 words are translated in the given locale.
*
* @param string $locale locale ex. en
*
* @return bool
*/
public static function localeHasDiffTwoDayWords($locale)
{
return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) {
return $newLocale &&
$translator->trans('diff_before_yesterday') !== 'diff_before_yesterday' &&
$translator->trans('diff_after_tomorrow') !== 'diff_after_tomorrow';
});
}
/**
* Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X).
* Support is considered enabled if the 4 sentences are translated in the given locale.
*
* @param string $locale locale ex. en
*
* @return bool
*/
public static function localeHasPeriodSyntax($locale)
{
return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) {
return $newLocale &&
$translator->trans('period_recurrences') !== 'period_recurrences' &&
$translator->trans('period_interval') !== 'period_interval' &&
$translator->trans('period_start_date') !== 'period_start_date' &&
$translator->trans('period_end_date') !== 'period_end_date';
});
}
/**
* Returns the list of internally available locales and already loaded custom locales.
* (It will ignore custom translator dynamic loading.)
*
* @return array
*/
public static function getAvailableLocales()
{
$translator = static::translator();
return $translator instanceof Translator
? $translator->getAvailableLocales()
: [$translator->getLocale()];
}
}
src/Carbon/Traits/Macro.php 0000644 00000005165 15014555553 0011576 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
/**
* Trait Boundaries.
*
* startOf, endOf and derived method for each unit.
*
* Depends on the following properties:
*
* @property int $year
* @property int $month
* @property int $daysInMonth
* @property int $quarter
*
* Depends on the following methods:
*
* @method $this setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0)
* @method $this setDate(int $year, int $month, int $day)
* @method $this addMonths(int $value = 1)
*/
trait Macro
{
/**
* The registered macros.
*
* @var array
*/
protected static $globalMacros = [];
/**
* The registered generic macros.
*
* @var array
*/
protected static $globalGenericMacros = [];
/**
* Register a custom macro.
*
* @param string $name
* @param object|callable $macro
*
* @return void
*/
public static function macro($name, $macro)
{
static::$globalMacros[$name] = $macro;
}
/**
* Remove all macros and generic macros.
*/
public static function resetMacros()
{
static::$globalMacros = [];
static::$globalGenericMacros = [];
}
/**
* Register a custom macro.
*
* @param object|callable $macro
* @param int $priority marco with higher priority is tried first
*
* @return void
*/
public static function genericMacro($macro, $priority = 0)
{
if (!isset(static::$globalGenericMacros[$priority])) {
static::$globalGenericMacros[$priority] = [];
krsort(static::$globalGenericMacros, SORT_NUMERIC);
}
static::$globalGenericMacros[$priority][] = $macro;
}
/**
* Mix another object into the class.
*
* @param object $mixin
*
* @return void
*/
public static function mixin($mixin)
{
$methods = (new \ReflectionClass($mixin))->getMethods(
\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED
);
foreach ($methods as $method) {
$method->setAccessible(true);
static::macro($method->name, $method->invoke($mixin));
}
}
/**
* Checks if macro is registered.
*
* @param string $name
*
* @return bool
*/
public static function hasMacro($name)
{
return isset(static::$globalMacros[$name]);
}
}
src/Carbon/Traits/Modifiers.php 0000644 00000027362 15014555553 0012461 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
/**
* Trait Modifiers.
*
* Returns dates relative to current date using modifier short-hand.
*/
trait Modifiers
{
/**
* Midday/noon hour.
*
* @var int
*/
protected static $midDayAt = 12;
/**
* get midday/noon hour
*
* @return int
*/
public static function getMidDayAt()
{
return static::$midDayAt;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather consider mid-day is always 12pm, then if you need to test if it's an other
* hour, test it explicitly:
* $date->format('G') == 13
* or to set explicitly to a given hour:
* $date->setTime(13, 0, 0, 0)
*
* Set midday/noon hour
*
* @param int $hour midday hour
*
* @return void
*/
public static function setMidDayAt($hour)
{
static::$midDayAt = $hour;
}
/**
* Modify to midday, default to self::$midDayAt
*
* @return static
*/
public function midDay()
{
return $this->setTime(static::$midDayAt, 0, 0, 0);
}
/**
* Modify to the next occurrence of a given day of the week.
* If no dayOfWeek is provided, modify to the next occurrence
* of the current day of the week. Use the supplied constants
* to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int|null $dayOfWeek
*
* @return static
*/
public function next($dayOfWeek = null)
{
if ($dayOfWeek === null) {
$dayOfWeek = $this->dayOfWeek;
}
return $this->startOfDay()->modify('next '.static::$days[$dayOfWeek]);
}
/**
* Go forward or backward to the next week- or weekend-day.
*
* @param bool $weekday
* @param bool $forward
*
* @return static
*/
private function nextOrPreviousDay($weekday = true, $forward = true)
{
/** @var CarbonInterface $step */
$date = $this;
$step = $forward ? 1 : -1;
do {
$date = $date->addDays($step);
} while ($weekday ? $date->isWeekend() : $date->isWeekday());
return $date;
}
/**
* Go forward to the next weekday.
*
* @return static
*/
public function nextWeekday()
{
return $this->nextOrPreviousDay();
}
/**
* Go backward to the previous weekday.
*
* @return static
*/
public function previousWeekday()
{
return $this->nextOrPreviousDay(true, false);
}
/**
* Go forward to the next weekend day.
*
* @return static
*/
public function nextWeekendDay()
{
return $this->nextOrPreviousDay(false);
}
/**
* Go backward to the previous weekend day.
*
* @return static
*/
public function previousWeekendDay()
{
return $this->nextOrPreviousDay(false, false);
}
/**
* Modify to the previous occurrence of a given day of the week.
* If no dayOfWeek is provided, modify to the previous occurrence
* of the current day of the week. Use the supplied constants
* to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int|null $dayOfWeek
*
* @return static
*/
public function previous($dayOfWeek = null)
{
if ($dayOfWeek === null) {
$dayOfWeek = $this->dayOfWeek;
}
return $this->startOfDay()->modify('last '.static::$days[$dayOfWeek]);
}
/**
* Modify to the first occurrence of a given day of the week
* in the current month. If no dayOfWeek is provided, modify to the
* first day of the current month. Use the supplied constants
* to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int|null $dayOfWeek
*
* @return static
*/
public function firstOfMonth($dayOfWeek = null)
{
$date = $this->startOfDay();
if ($dayOfWeek === null) {
return $date->day(1);
}
return $date->modify('first '.static::$days[$dayOfWeek].' of '.$date->format('F').' '.$date->year);
}
/**
* Modify to the last occurrence of a given day of the week
* in the current month. If no dayOfWeek is provided, modify to the
* last day of the current month. Use the supplied constants
* to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int|null $dayOfWeek
*
* @return static
*/
public function lastOfMonth($dayOfWeek = null)
{
$date = $this->startOfDay();
if ($dayOfWeek === null) {
return $date->day($date->daysInMonth);
}
return $date->modify('last '.static::$days[$dayOfWeek].' of '.$date->format('F').' '.$date->year);
}
/**
* Modify to the given occurrence of a given day of the week
* in the current month. If the calculated occurrence is outside the scope
* of the current month, then return false and no modifications are made.
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int $nth
* @param int $dayOfWeek
*
* @return mixed
*/
public function nthOfMonth($nth, $dayOfWeek)
{
$date = $this->copy()->firstOfMonth();
$check = $date->format('Y-m');
$date = $date->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
return $date->format('Y-m') === $check ? $this->modify($date) : false;
}
/**
* Modify to the first occurrence of a given day of the week
* in the current quarter. If no dayOfWeek is provided, modify to the
* first day of the current quarter. Use the supplied constants
* to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int|null $dayOfWeek day of the week default null
*
* @return static
*/
public function firstOfQuarter($dayOfWeek = null)
{
return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER - 2, 1)->firstOfMonth($dayOfWeek);
}
/**
* Modify to the last occurrence of a given day of the week
* in the current quarter. If no dayOfWeek is provided, modify to the
* last day of the current quarter. Use the supplied constants
* to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int|null $dayOfWeek day of the week default null
*
* @return static
*/
public function lastOfQuarter($dayOfWeek = null)
{
return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER, 1)->lastOfMonth($dayOfWeek);
}
/**
* Modify to the given occurrence of a given day of the week
* in the current quarter. If the calculated occurrence is outside the scope
* of the current quarter, then return false and no modifications are made.
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int $nth
* @param int $dayOfWeek
*
* @return mixed
*/
public function nthOfQuarter($nth, $dayOfWeek)
{
$date = $this->copy()->day(1)->month($this->quarter * static::MONTHS_PER_QUARTER);
$lastMonth = $date->month;
$year = $date->year;
$date = $date->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
return ($lastMonth < $date->month || $year !== $date->year) ? false : $this->modify($date);
}
/**
* Modify to the first occurrence of a given day of the week
* in the current year. If no dayOfWeek is provided, modify to the
* first day of the current year. Use the supplied constants
* to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int|null $dayOfWeek day of the week default null
*
* @return static
*/
public function firstOfYear($dayOfWeek = null)
{
return $this->month(1)->firstOfMonth($dayOfWeek);
}
/**
* Modify to the last occurrence of a given day of the week
* in the current year. If no dayOfWeek is provided, modify to the
* last day of the current year. Use the supplied constants
* to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int|null $dayOfWeek day of the week default null
*
* @return static
*/
public function lastOfYear($dayOfWeek = null)
{
return $this->month(static::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek);
}
/**
* Modify to the given occurrence of a given day of the week
* in the current year. If the calculated occurrence is outside the scope
* of the current year, then return false and no modifications are made.
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
*
* @param int $nth
* @param int $dayOfWeek
*
* @return mixed
*/
public function nthOfYear($nth, $dayOfWeek)
{
$date = $this->copy()->firstOfYear()->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
return $this->year === $date->year ? $this->modify($date) : false;
}
/**
* Modify the current instance to the average of a given instance (default now) and the current instance.
*
* @param \Carbon\Carbon|\DateTimeInterface|null $date
*
* @return static
*/
public function average($date = null)
{
return $this->addSeconds((int) ($this->diffInSeconds($this->resolveCarbon($date), false) / 2));
}
/**
* Get the closest date from the instance.
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date1
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date2
*
* @return static
*/
public function closest($date1, $date2)
{
return $this->diffInSeconds($date1) < $this->diffInSeconds($date2) ? $date1 : $date2;
}
/**
* Get the farthest date from the instance.
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date1
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date2
*
* @return static
*/
public function farthest($date1, $date2)
{
return $this->diffInSeconds($date1) > $this->diffInSeconds($date2) ? $date1 : $date2;
}
/**
* Get the minimum instance between a given instance (default now) and the current instance.
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @return static
*/
public function min($date = null)
{
$date = $this->resolveCarbon($date);
return $this->lt($date) ? $this : $date;
}
/**
* Get the minimum instance between a given instance (default now) and the current instance.
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see min()
*
* @return static
*/
public function minimum($date = null)
{
return $this->min($date);
}
/**
* Get the maximum instance between a given instance (default now) and the current instance.
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @return static
*/
public function max($date = null)
{
$date = $this->resolveCarbon($date);
return $this->gt($date) ? $this : $date;
}
/**
* Get the maximum instance between a given instance (default now) and the current instance.
*
* @param \Carbon\Carbon|\DateTimeInterface|mixed $date
*
* @see max()
*
* @return static
*/
public function maximum($date = null)
{
return $this->max($date);
}
}
src/Carbon/Traits/Mutability.php 0000644 00000002421 15014555553 0012650 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use DateTimeInterface;
/**
* Trait Mutability.
*
* Utils to know if the current object is mutable or immutable and convert it.
*/
trait Mutability
{
/**
* Returns true if the current class/instance is mutable.
*
* @return bool
*/
public static function isMutable()
{
return false;
}
/**
* Returns true if the current class/instance is immutable.
*
* @return bool
*/
public static function isImmutable()
{
return !static::isMutable();
}
/**
* Return a mutable copy of the instance.
*
* @return Carbon
*/
public function toMutable()
{
/* @var DateTimeInterface $this */
return Carbon::instance($this);
}
/**
* Return a immutable copy of the instance.
*
* @return CarbonImmutable
*/
public function toImmutable()
{
/* @var DateTimeInterface $this */
return CarbonImmutable::instance($this);
}
}
src/Carbon/Traits/Options.php 0000644 00000023140 15014555553 0012161 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\CarbonInterface;
/**
* Trait Options.
*
* Embed base methods to change settings of Carbon classes.
*
* Depends on the following methods:
*
* @method \Carbon\Carbon|\Carbon\CarbonImmutable setTimezone($timezone) Set the timezone
*/
trait Options
{
use Localization;
/**
* Customizable PHP_INT_SIZE override.
*
* @var int
*/
public static $PHPIntSize = PHP_INT_SIZE;
/**
* First day of week.
*
* @var int
*/
protected static $weekStartsAt = CarbonInterface::MONDAY;
/**
* Last day of week.
*
* @var int
*/
protected static $weekEndsAt = CarbonInterface::SUNDAY;
/**
* Days of weekend.
*
* @var array
*/
protected static $weekendDays = [
CarbonInterface::SATURDAY,
CarbonInterface::SUNDAY,
];
/**
* Format regex patterns.
*
* @var array
*/
protected static $regexFormats = [
'd' => '(3[01]|[12][0-9]|0[1-9])',
'D' => '([a-zA-Z]{3})',
'j' => '([123][0-9]|[1-9])',
'l' => '([a-zA-Z]{2,})',
'N' => '([1-7])',
'S' => '([a-zA-Z]{2})',
'w' => '([0-6])',
'z' => '(36[0-5]|3[0-5][0-9]|[12][0-9]{2}|[1-9]?[0-9])',
'W' => '(5[012]|[1-4][0-9]|[1-9])',
'F' => '([a-zA-Z]{2,})',
'm' => '(1[012]|0[1-9])',
'M' => '([a-zA-Z]{3})',
'n' => '(1[012]|[1-9])',
't' => '(2[89]|3[01])',
'L' => '(0|1)',
'o' => '([1-9][0-9]{0,4})',
'Y' => '([1-9][0-9]{0,4})',
'y' => '([0-9]{2})',
'a' => '(am|pm)',
'A' => '(AM|PM)',
'B' => '([0-9]{3})',
'g' => '(1[012]|[1-9])',
'G' => '(2[0-3]|1?[0-9])',
'h' => '(1[012]|0[1-9])',
'H' => '(2[0-3]|[01][0-9])',
'i' => '([0-5][0-9])',
's' => '([0-5][0-9])',
'u' => '([0-9]{1,6})',
'v' => '([0-9]{1,3})',
'e' => '([a-zA-Z]{1,5})|([a-zA-Z]*\/[a-zA-Z]*)',
'I' => '(0|1)',
'O' => '([\+\-](1[012]|0[0-9])[0134][05])',
'P' => '([\+\-](1[012]|0[0-9]):[0134][05])',
'T' => '([a-zA-Z]{1,5})',
'Z' => '(-?[1-5]?[0-9]{1,4})',
'U' => '([0-9]*)',
// The formats below are combinations of the above formats.
'c' => '(([1-9][0-9]{0,4})\-(1[012]|0[1-9])\-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[\+\-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP
'r' => '(([a-zA-Z]{3}), ([123][0-9]|[1-9]) ([a-zA-Z]{3}) ([1-9][0-9]{0,4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [\+\-](1[012]|0[0-9])([0134][05]))', // D, j M Y H:i:s O
];
/**
* Indicates if months should be calculated with overflow.
* Global setting.
*
* @var bool
*/
protected static $monthsOverflow = true;
/**
* Indicates if years should be calculated with overflow.
* Global setting.
*
* @var bool
*/
protected static $yearsOverflow = true;
/**
* Indicates if the strict mode is in use.
* Global setting.
*
* @var bool
*/
protected static $strictModeEnabled = true;
/**
* Indicates if months should be calculated with overflow.
* Specific setting.
*
* @var bool|null
*/
protected $localMonthsOverflow = null;
/**
* Indicates if years should be calculated with overflow.
* Specific setting.
*
* @var bool|null
*/
protected $localYearsOverflow = null;
/**
* Indicates if the strict mode is in use.
* Specific setting.
*
* @var bool|null
*/
protected $localStrictModeEnabled = null;
/**
* Options for diffForHumans and forHumans methods.
*
* @var bool|null
*/
protected $localHumanDiffOptions = null;
/**
* Format to use on string cast.
*
* @var string|null
*/
protected $localToStringFormat = null;
/**
* Format to use on JSON serialization.
*
* @var string|null
*/
protected $localSerializer = null;
/**
* Instance-specific macros.
*
* @var array|null
*/
protected $localMacros = null;
/**
* Instance-specific generic macros.
*
* @var array|null
*/
protected $localGenericMacros = null;
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* @see settings
*
* Enable the strict mode (or disable with passing false).
*
* @param bool $strictModeEnabled
*/
public static function useStrictMode($strictModeEnabled = true)
{
static::$strictModeEnabled = $strictModeEnabled;
}
/**
* Returns true if the strict mode is globally in use, false else.
* (It can be overridden in specific instances.)
*
* @return bool
*/
public static function isStrictModeEnabled()
{
return static::$strictModeEnabled;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @see settings
*
* Indicates if months should be calculated with overflow.
*
* @param bool $monthsOverflow
*
* @return void
*/
public static function useMonthsOverflow($monthsOverflow = true)
{
static::$monthsOverflow = $monthsOverflow;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @see settings
*
* Reset the month overflow behavior.
*
* @return void
*/
public static function resetMonthsOverflow()
{
static::$monthsOverflow = true;
}
/**
* Get the month overflow global behavior (can be overridden in specific instances).
*
* @return bool
*/
public static function shouldOverflowMonths()
{
return static::$monthsOverflow;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @see settings
*
* Indicates if years should be calculated with overflow.
*
* @param bool $yearsOverflow
*
* @return void
*/
public static function useYearsOverflow($yearsOverflow = true)
{
static::$yearsOverflow = $yearsOverflow;
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use the ->settings() method.
* Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
* @see settings
*
* Reset the month overflow behavior.
*
* @return void
*/
public static function resetYearsOverflow()
{
static::$yearsOverflow = true;
}
/**
* Get the month overflow global behavior (can be overridden in specific instances).
*
* @return bool
*/
public static function shouldOverflowYears()
{
return static::$yearsOverflow;
}
/**
* Set specific options.
* - strictMode: true|false|null
* - monthOverflow: true|false|null
* - yearOverflow: true|false|null
* - humanDiffOptions: int|null
* - toStringFormat: string|Closure|null
* - toJsonFormat: string|Closure|null
* - locale: string|null
* - timezone: \DateTimeZone|string|int|null
* - macros: array|null
* - genericMacros: array|null
*
* @param array $settings
*
* @return $this
*/
public function settings(array $settings)
{
$this->localStrictModeEnabled = $settings['strictMode'] ?? null;
$this->localMonthsOverflow = $settings['monthOverflow'] ?? null;
$this->localYearsOverflow = $settings['yearOverflow'] ?? null;
$this->localHumanDiffOptions = $settings['humanDiffOptions'] ?? null;
$this->localToStringFormat = $settings['toStringFormat'] ?? null;
$this->localSerializer = $settings['toJsonFormat'] ?? null;
$this->localMacros = $settings['macros'] ?? null;
$this->localGenericMacros = $settings['genericMacros'] ?? null;
$date = $this;
if (isset($settings['locale'])) {
$date = $date->locale($settings['locale']);
}
if (isset($settings['timezone'])) {
$date = $date->shiftTimezone($settings['timezone']);
}
return $date;
}
}
src/Carbon/Traits/Rounding.php 0000644 00000014031 15014555553 0012312 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\CarbonInterface;
use InvalidArgumentException;
/**
* Trait Rounding.
*
* Round, ceil, floor units.
*/
trait Rounding
{
/**
* Round the current instance at the given unit with given precision if specified and the given function.
*
* @param string $unit
* @param float $precision
* @param string $function
*
* @return CarbonInterface
*/
public function roundUnit($unit, $precision = 1, $function = 'round')
{
$metaUnits = [
// @call roundUnit
'millennium' => [static::YEARS_PER_MILLENNIUM, 'year'],
// @call roundUnit
'century' => [static::YEARS_PER_CENTURY, 'year'],
// @call roundUnit
'decade' => [static::YEARS_PER_DECADE, 'year'],
// @call roundUnit
'quarter' => [static::MONTHS_PER_QUARTER, 'month'],
// @call roundUnit
'millisecond' => [1000, 'microsecond'],
];
$normalizedUnit = static::singularUnit($unit);
$ranges = array_merge(static::getRangesByUnit(), [
// @call roundUnit
'microsecond' => [0, 999999],
]);
$factor = 1;
if (isset($metaUnits[$normalizedUnit])) {
list($factor, $normalizedUnit) = $metaUnits[$normalizedUnit];
}
$precision *= $factor;
if (!isset($ranges[$normalizedUnit])) {
throw new InvalidArgumentException("Unknown unit '$unit' to floor");
}
$found = false;
$fraction = 0;
$arguments = null;
$factor = $this->year < 0 ? -1 : 1;
$changes = [];
foreach ($ranges as $unit => $range) {
list($minimum, $maximum) = $range;
if ($normalizedUnit === $unit) {
$arguments = [$this->$unit, $minimum];
$fraction = $precision - floor($precision);
$found = true;
continue;
}
if ($found) {
$delta = $maximum + 1 - $minimum;
$factor /= $delta;
$fraction *= $delta;
$arguments[0] += $this->$unit * $factor;
$changes[$unit] = round($minimum + ($fraction ? $fraction * call_user_func($function, ($this->$unit - $minimum) / $fraction) : 0));
// Cannot use modulo as it lose double precision
while ($changes[$unit] >= $delta) {
$changes[$unit] -= $delta;
}
$fraction -= floor($fraction);
}
}
list($value, $minimum) = $arguments;
/** @var CarbonInterface $result */
$result = $this->$normalizedUnit(floor(call_user_func($function, ($value - $minimum) / $precision) * $precision + $minimum));
foreach ($changes as $unit => $value) {
$result = $result->$unit($value);
}
return $result;
}
/**
* Truncate the current instance at the given unit with given precision if specified.
*
* @param string $unit
* @param float $precision
*
* @return CarbonInterface
*/
public function floorUnit($unit, $precision = 1)
{
return $this->roundUnit($unit, $precision, 'floor');
}
/**
* Ceil the current instance at the given unit with given precision if specified.
*
* @param string $unit
* @param float $precision
*
* @return CarbonInterface
*/
public function ceilUnit($unit, $precision = 1)
{
return $this->roundUnit($unit, $precision, 'ceil');
}
/**
* Round the current instance second with given precision if specified.
*
* @param float $precision
* @param string $function
*
* @return CarbonInterface
*/
public function round($precision = 1, $function = 'round')
{
return $this->roundUnit('second', $precision, $function);
}
/**
* Round the current instance second with given precision if specified.
*
* @param float $precision
*
* @return CarbonInterface
*/
public function floor($precision = 1)
{
return $this->roundUnit('second', $precision, 'floor');
}
/**
* Ceil the current instance second with given precision if specified.
*
* @param float $precision
*
* @return CarbonInterface
*/
public function ceil($precision = 1)
{
return $this->roundUnit('second', $precision, 'ceil');
}
/**
* Round the current instance week.
*
* @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week
*
* @return CarbonInterface
*/
public function roundWeek($weekStartsAt = null)
{
return $this->closest($this->copy()->floorWeek($weekStartsAt), $this->copy()->ceilWeek($weekStartsAt));
}
/**
* Truncate the current instance week.
*
* @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week
*
* @return CarbonInterface
*/
public function floorWeek($weekStartsAt = null)
{
return $this->startOfWeek($weekStartsAt);
}
/**
* Ceil the current instance week.
*
* @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week
*
* @return CarbonInterface
*/
public function ceilWeek($weekStartsAt = null)
{
if ($this->isMutable()) {
$startOfWeek = $this->copy()->startOfWeek($weekStartsAt);
return $startOfWeek != $this ?
$this->startOfWeek($weekStartsAt)->addWeek() :
$this;
}
$startOfWeek = $this->startOfWeek($weekStartsAt);
return $startOfWeek != $this ?
$startOfWeek->addWeek() :
$this->copy();
}
}
src/Carbon/Traits/Serialization.php 0000644 00000007205 15014555553 0013347 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use InvalidArgumentException;
/**
* Trait Serialization.
*
* Serialization and JSON stuff.
*
* Depends on the following properties:
*
* @property int $year
* @property int $month
* @property int $daysInMonth
* @property int $quarter
*
* Depends on the following methods:
*
* @method string|static locale(string $locale = null)
* @method string toJSON()
*/
trait Serialization
{
/**
* The custom Carbon JSON serializer.
*
* @var callable|null
*/
protected static $serializer;
/**
* Locale to dump comes here before serialization.
*
* @var string
*/
protected $dumpLocale = null;
/**
* Return a serialized string of the instance.
*
* @return string
*/
public function serialize()
{
return serialize($this);
}
/**
* Create an instance from a serialized string.
*
* @param string $value
*
* @throws \InvalidArgumentException
*
* @return static
*/
public static function fromSerialized($value)
{
$instance = @unserialize($value);
if (!$instance instanceof static) {
throw new InvalidArgumentException('Invalid serialized value.');
}
return $instance;
}
/**
* The __set_state handler.
*
* @param string|array $dump
*
* @return static
*/
public static function __set_state($dump)
{
if (is_string($dump)) {
return static::parse($dump);
}
/** @var \DateTimeInterface $date */
$date = get_parent_class(static::class) && method_exists(parent::class, '__set_state')
? parent::__set_state($dump)
: (object) $dump;
return static::instance($date);
}
/**
* Returns the list of properties to dump on serialize() called on.
*
* @return array
*/
public function __sleep()
{
$properties = ['date', 'timezone_type', 'timezone'];
if ($this->localTranslator ?? null) {
$properties[] = 'dumpLocale';
$this->dumpLocale = $this->locale ?? null;
}
return $properties;
}
/**
* Set locale if specified on unserialize() called.
*/
public function __wakeup()
{
if (get_parent_class() && method_exists(parent::class, '__wakeup')) {
parent::__wakeup();
}
if (isset($this->dumpLocale)) {
$this->locale($this->dumpLocale);
$this->dumpLocale = null;
}
}
/**
* Prepare the object for JSON serialization.
*
* @return array|string
*/
public function jsonSerialize()
{
$serializer = $this->localSerializer ?? static::$serializer;
if ($serializer) {
return is_string($serializer)
? $this->format($serializer)
: call_user_func($serializer, $this);
}
return $this->toJSON();
}
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather transform Carbon object before the serialization.
*
* JSON serialize all Carbon instances using the given callback.
*
* @param callable $callback
*
* @return void
*/
public static function serializeUsing($callback)
{
static::$serializer = $callback;
}
}
src/Carbon/Traits/Test.php 0000644 00000004071 15014555553 0011447 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
/**
* Trait Timestamp.
*/
trait Timestamp
{
/**
* Create a Carbon instance from a timestamp.
*
* @param int $timestamp
* @param \DateTimeZone|string|null $tz
*
* @return static
*/
public static function createFromTimestamp($timestamp, $tz = null)
{
return static::today($tz)->setTimestamp($timestamp);
}
/**
* Create a Carbon instance from a timestamp in milliseconds.
*
* @param int $timestamp
* @param \DateTimeZone|string|null $tz
*
* @return static
*/
public static function createFromTimestampMs($timestamp, $tz = null)
{
return static::createFromFormat('U.u', sprintf('%F', $timestamp / 1000))
->setTimezone($tz);
}
/**
* Create a Carbon instance from an UTC timestamp.
*
* @param int $timestamp
*
* @return static
*/
public static function createFromTimestampUTC($timestamp)
{
return new static('@'.$timestamp);
}
/**
* Set the instance's timestamp.
*
* @param int $value
*
* @return static
*/
public function timestamp($value)
{
return $this->setTimestamp($value);
}
/**
* Returns a timestamp rounded with the given precision (6 by default).
*
* @example getPreciseTimestamp() 1532087464437474 (microsecond maximum precision)
* @example getPreciseTimestamp(6) 1532087464437474
* @example getPreciseTimestamp(5) 153208746443747 (1/100000 second precision)
* @example getPreciseTimestamp(4) 15320874644375 (1/10000 second precision)
* @example getPreciseTimestamp(3) 1532087464437 (millisecond precision)
* @example getPreciseTimestamp(2) 153208746444 (1/100 second precision)
* @example getPreciseTimestamp(1) 15320874644 (1/10 second precision)
* @example getPreciseTimestamp(0) 1532087464 (second precision)
* @example getPreciseTimestamp(-1) 153208746 (10 second precision)
* @example getPreciseTimestamp(-2) 15320875 (100 second precision)
*
* @param int $precision
*
* @return float
*/
public function getPreciseTimestamp($precision = 6)
{
return round($this->format('Uu') / pow(10, 6 - $precision));
}
/**
* Returns the milliseconds timestamps used amongst other by Date javascript objects.
*
* @return float
*/
public function valueOf()
{
return $this->getPreciseTimestamp(3);
}
/**
* @alias getTimestamp
*
* Returns the UNIX timestamp for the current date.
*
* @return int
*/
public function unix()
{
return $this->getTimestamp();
}
}
src/Carbon/Traits/Units.php 0000644 00000023676 15014555553 0011646 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\CarbonInterface;
use Carbon\CarbonInterval;
use DateInterval;
use InvalidArgumentException;
/**
* Trait Units.
*
* Add, subtract and set units.
*/
trait Units
{
/**
* Add seconds to the instance using timestamp. Positive $value travels
* forward while negative $value travels into the past.
*
* @param string $unit
* @param int $value
*
* @return static
*/
public function addRealUnit($unit, $value = 1)
{
switch ($unit) {
case 'micro':
// @call addRealUnit
case 'microsecond':
/* @var CarbonInterface $this */
$diff = $this->microsecond + $value;
$time = $this->getTimestamp();
$seconds = floor($diff / static::MICROSECONDS_PER_SECOND);
$time += $seconds;
$diff -= $seconds * static::MICROSECONDS_PER_SECOND;
$microtime = str_pad($diff, 6, '0', STR_PAD_LEFT);
return $this->modify("@$time.$microtime");
// @call addRealUnit
case 'second':
break;
// @call addRealUnit
case 'minute':
$value *= static::SECONDS_PER_MINUTE;
break;
// @call addRealUnit
case 'hour':
$value *= static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE;
break;
// @call addRealUnit
case 'day':
$value *= static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE;
break;
// @call addRealUnit
case 'week':
$value *= static::DAYS_PER_WEEK * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE;
break;
// @call addRealUnit
case 'month':
$value *= 30 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE;
break;
// @call addRealUnit
case 'quarter':
$value *= static::MONTHS_PER_QUARTER * 30 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE;
break;
// @call addRealUnit
case 'year':
$value *= 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE;
break;
// @call addRealUnit
case 'decade':
$value *= static::YEARS_PER_DECADE * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE;
break;
// @call addRealUnit
case 'century':
$value *= static::YEARS_PER_CENTURY * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE;
break;
// @call addRealUnit
case 'millennium':
$value *= static::YEARS_PER_MILLENNIUM * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE;
break;
default:
if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) {
throw new InvalidArgumentException("Invalid unit for real timestamp add/sub: '$unit'");
}
return $this;
}
/* @var CarbonInterface $this */
return $this->setTimestamp($this->getTimestamp() + $value);
}
public function subRealUnit($unit, $value = 1)
{
return $this->addRealUnit($unit, -$value);
}
/**
* Returns true if a property can be changed via setter.
*
* @param string $unit
*
* @return bool
*/
public static function isModifiableUnit($unit)
{
static $modifiableUnits = [
// @call addUnit
'millennium',
// @call addUnit
'century',
// @call addUnit
'decade',
// @call addUnit
'quarter',
// @call addUnit
'week',
// @call addUnit
'weekday',
];
return in_array($unit, $modifiableUnits) || in_array($unit, static::$units);
}
/**
* Add given units or interval to the current instance.
*
* @example $date->add('hour', 3)
* @example $date->add(15, 'days')
* @example $date->add(CarbonInterval::days(4))
*
* @param string|DateInterval $unit
* @param int $value
* @param bool|null $overflow
*
* @return CarbonInterface
*/
public function add($unit, $value = 1, $overflow = null)
{
if (is_string($unit) && func_num_args() === 1) {
$unit = CarbonInterval::make($unit);
}
if ($unit instanceof DateInterval) {
return parent::add($unit);
}
if (is_numeric($unit)) {
$tempUnit = $value;
$value = $unit;
$unit = $tempUnit;
}
return $this->addUnit($unit, $value, $overflow);
}
/**
* Add given units to the current instance.
*
* @param string|DateInterval $unit
* @param int $value
* @param bool|null $overflow
*
* @return CarbonInterface
*/
public function addUnit($unit, $value = 1, $overflow = null)
{
/** @var CarbonInterface $date */
$date = $this;
if (!is_numeric($value) || !floatval($value)) {
return $date->isMutable() ? $date : $date->copy();
}
$metaUnits = [
'millennium' => [static::YEARS_PER_MILLENNIUM, 'year'],
'century' => [static::YEARS_PER_CENTURY, 'year'],
'decade' => [static::YEARS_PER_DECADE, 'year'],
'quarter' => [static::MONTHS_PER_QUARTER, 'month'],
];
if (isset($metaUnits[$unit])) {
list($factor, $unit) = $metaUnits[$unit];
$value *= $factor;
}
if ($unit === 'weekday') {
$weekendDays = static::getWeekendDays();
if ($weekendDays !== [static::SATURDAY, static::SUNDAY]) {
$absoluteValue = abs($value);
$sign = $value / max(1, $absoluteValue);
$weekDaysCount = 7 - min(6, count(array_unique($weekendDays)));
$weeks = floor($absoluteValue / $weekDaysCount);
for ($diff = $absoluteValue % $weekDaysCount; $diff; $diff--) {
$date = $date->addDays($sign);
while (in_array($date->dayOfWeek, $weekendDays)) {
$date = $date->addDays($sign);
}
}
$value = $weeks * $sign;
$unit = 'week';
}
$timeString = $date->toTimeString();
} elseif ($canOverflow = in_array($unit, [
'month',
'year',
]) && ($overflow === false || (
$overflow === null &&
($ucUnit = ucfirst($unit).'s') &&
!($this->{'local'.$ucUnit.'Overflow'} ?? static::{'shouldOverflow'.$ucUnit}())
))) {
$day = $date->day;
}
$value = (int) $value;
// Wor-around for bug https://bugs.php.net/bug.php?id=75642
if ($unit === 'micro' || $unit === 'microsecond') {
$microseconds = $this->micro + $value;
$second = floor($microseconds / static::MICROSECONDS_PER_SECOND);
$microseconds %= static::MICROSECONDS_PER_SECOND;
if ($microseconds < 0) {
$microseconds += static::MICROSECONDS_PER_SECOND;
}
$date = $date->microseconds($microseconds);
$unit = 'second';
$value = $second;
}
$date = $date->modify("$value $unit");
if (isset($timeString)) {
return $date->setTimeFromTimeString($timeString);
}
if (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) {
$date = $date->modify('last day of previous month');
}
return $date;
}
/**
* Subtract given units to the current instance.
*
* @param string $unit
* @param int $value
* @param bool|null $overflow
*
* @return CarbonInterface
*/
public function subUnit($unit, $value = 1, $overflow = null)
{
return $this->addUnit($unit, -$value, $overflow);
}
/**
* Subtract given units or interval to the current instance.
*
* @example $date->sub('hour', 3)
* @example $date->sub(15, 'days')
* @example $date->sub(CarbonInterval::days(4))
*
* @param string $unit
* @param int $value
* @param bool|null $overflow
*
* @return CarbonInterface
*/
public function sub($unit, $value = 1, $overflow = null)
{
if (is_string($unit) && func_num_args() === 1) {
$unit = CarbonInterval::make($unit);
}
if ($unit instanceof DateInterval) {
return parent::sub($unit);
}
if (is_numeric($unit)) {
$_unit = $value;
$value = $unit;
$unit = $_unit;
unset($_unit);
}
return $this->addUnit($unit, -floatval($value), $overflow);
}
/**
* Subtract given units or interval to the current instance.
*
* @see sub()
*
* @param string $unit
* @param int $value
* @param bool|null $overflow
*
* @return CarbonInterface
*/
public function subtract($unit, $value = 1, $overflow = null)
{
if (is_string($unit) && func_num_args() === 1) {
$unit = CarbonInterval::make($unit);
}
return $this->sub($unit, $value, $overflow);
}
}
src/Carbon/Traits/Week.php 0000644 00000017073 15014555553 0011431 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\CarbonInterface;
/**
* Trait Week.
*
* week and ISO week number, year and count in year.
*
* Depends on the following properties:
*
* @property int $daysInYear
* @property int $dayOfWeek
* @property int $dayOfYear
* @property int $year
*
* Depends on the following methods:
*
* @method CarbonInterface|static addWeeks(int $weeks = 1)
* @method CarbonInterface|static copy()
* @method CarbonInterface|static dayOfYear(int $dayOfYear)
* @method string getTranslationMessage(string $key)
* @method CarbonInterface|static next(int $day)
* @method CarbonInterface|static startOfWeek(int $day = 1)
* @method CarbonInterface|static subWeeks(int $weeks = 1)
* @method CarbonInterface|static year(int $year = null)
*/
trait Week
{
/**
* Set/get the week number of year using given first day of week and first
* day of year included in the first week. Or use ISO format if no settings
* given.
*
* @param int|null $year if null, act as a getter, if not null, set the year and return current instance.
* @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
* @param int|null $dayOfYear first day of year included in the week #1
*
* @return int|static
*/
public function isoWeekYear($year = null, $dayOfWeek = null, $dayOfYear = null)
{
return $this->weekYear(
$year,
$dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 1,
$dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 4
);
}
/**
* Set/get the week number of year using given first day of week and first
* day of year included in the first week. Or use US format if no settings
* given (Sunday / Jan 6).
*
* @param int|null $year if null, act as a getter, if not null, set the year and return current instance.
* @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
* @param int|null $dayOfYear first day of year included in the week #1
*
* @return int|static
*/
public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null)
{
$dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 0;
$dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1;
if ($year !== null) {
$year = (int) round($year);
if ($this->weekYear(null, $dayOfWeek, $dayOfYear) === $year) {
return $this->copy();
}
$week = $this->week(null, $dayOfWeek, $dayOfYear);
$day = $this->dayOfWeek;
$date = $this->year($year);
switch ($date->weekYear(null, $dayOfWeek, $dayOfYear) - $year) {
case 1:
$date = $date->subWeeks(26);
break;
case -1:
$date = $date->addWeeks(26);
break;
}
$date = $date->addWeeks($week - $date->week(null, $dayOfWeek, $dayOfYear))->startOfWeek($dayOfWeek);
if ($date->dayOfWeek === $day) {
return $date;
}
return $date->next($day);
}
$year = $this->year;
$day = $this->dayOfYear;
$date = $this->copy()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek);
if ($date->year === $year && $day < $date->dayOfYear) {
return $year - 1;
}
$date = $this->copy()->addYear()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek);
if ($date->year === $year && $day >= $date->dayOfYear) {
return $year + 1;
}
return $year;
}
/**
* Get the number of weeks of the current week-year using given first day of week and first
* day of year included in the first week. Or use ISO format if no settings
* given.
*
* @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
* @param int|null $dayOfYear first day of year included in the week #1
*
* @return int
*/
public function isoWeeksInYear($dayOfWeek = null, $dayOfYear = null)
{
return $this->weeksInYear(
$dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 1,
$dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 4
);
}
/**
* Get the number of weeks of the current week-year using given first day of week and first
* day of year included in the first week. Or use US format if no settings
* given (Sunday / Jan 6).
*
* @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
* @param int|null $dayOfYear first day of year included in the week #1
*
* @return int
*/
public function weeksInYear($dayOfWeek = null, $dayOfYear = null)
{
$dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 0;
$dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1;
$year = $this->year;
$start = $this->copy()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek);
$startDay = $start->dayOfYear;
if ($start->year !== $year) {
$startDay -= $start->daysInYear;
}
$end = $this->copy()->addYear()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek);
$endDay = $end->dayOfYear;
if ($end->year !== $year) {
$endDay += $this->daysInYear;
}
return (int) round(($endDay - $startDay) / 7);
}
/**
* Get/set the week number using given first day of week and first
* day of year included in the first week. Or use US format if no settings
* given (Sunday / Jan 6).
*
* @param int|null $week
* @param int|null $dayOfWeek
* @param int|null $dayOfYear
*
* @return int|static
*/
public function week($week = null, $dayOfWeek = null, $dayOfYear = null)
{
$date = $this;
$dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 0;
$dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1;
if ($week !== null) {
return $date->addWeeks(round($week) - $this->week(null, $dayOfWeek, $dayOfYear));
}
$start = $date->copy()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek);
$end = $date->copy()->startOfWeek($dayOfWeek);
if ($start > $end) {
$start = $start->subWeeks(26)->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek);
}
$week = (int) ($start->diffInDays($end) / 7 + 1);
return $week > $end->weeksInYear($dayOfWeek, $dayOfYear) ? 1 : $week;
}
/**
* Get/set the week number using given first day of week and first
* day of year included in the first week. Or use ISO format if no settings
* given.
*
* @param int|null $week
* @param int|null $dayOfWeek
* @param int|null $dayOfYear
*
* @return int|static
*/
public function isoWeek($week = null, $dayOfWeek = null, $dayOfYear = null)
{
return $this->week(
$week,
$dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 1,
$dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 4
);
}
}
src/Carbon/Translator.php 0000644 00000020360 15014555553 0011412 0 ustar 00 directories = [__DIR__.'/Lang'];
$this->addLoader('array', new Translation\Loader\ArrayLoader());
parent::__construct($locale, $formatter, $cacheDir, $debug);
}
/**
* Returns the list of directories translation files are searched in.
*
* @return array
*/
public function getDirectories(): array
{
return $this->directories;
}
/**
* Set list of directories translation files are searched in.
*
* @param array $directories new directories list
*
* @return $this
*/
public function setDirectories(array $directories)
{
$this->directories = $directories;
return $this;
}
/**
* Add a directory to the list translation files are searched in.
*
* @param string $directory new directory
*
* @return $this
*/
public function addDirectory(string $directory)
{
$this->directories[] = $directory;
return $this;
}
/**
* Remove a directory from the list translation files are searched in.
*
* @param string $directory directory path
*
* @return $this
*/
public function removeDirectory(string $directory)
{
$search = rtrim(strtr($directory, '\\', '/'), '/');
return $this->setDirectories(array_filter($this->getDirectories(), function ($item) use ($search) {
return rtrim(strtr($item, '\\', '/'), '/') !== $search;
}));
}
public function trans($id, array $parameters = [], $domain = null, $locale = null)
{
if (null === $domain) {
$domain = 'messages';
}
$format = $this->getCatalogue($locale)->get((string) $id, $domain);
if ($format instanceof Closure) {
return $format(...array_values($parameters));
}
return parent::trans($id, $parameters, $domain, $locale);
}
/**
* Reset messages of a locale (all locale if no locale passed).
* Remove custom messages and reload initial messages from matching
* file in Lang directory.
*
* @param string|null $locale
*
* @return bool
*/
public function resetMessages($locale = null)
{
if ($locale === null) {
$this->messages = [];
return true;
}
foreach ($this->getDirectories() as $directory) {
$directory = rtrim($directory, '\\/');
if (file_exists($filename = "$directory/$locale.php")) {
$this->messages[$locale] = require $filename;
$this->addResource('array', $this->messages[$locale], $locale);
return true;
}
}
return false;
}
/**
* Returns the list of files matching a given locale prefix (or all if empty).
*
* @param string $prefix prefix required to filter result
*
* @return array
*/
public function getLocalesFiles($prefix = '')
{
$files = [];
foreach ($this->getDirectories() as $directory) {
$directory = rtrim($directory, '\\/');
foreach (glob("$directory/$prefix*.php") as $file) {
$files[] = $file;
}
}
return array_unique($files);
}
/**
* Returns the list of internally available locales and already loaded custom locales.
* (It will ignore custom translator dynamic loading.)
*
* @param string $prefix prefix required to filter result
*
* @return array
*/
public function getAvailableLocales($prefix = '')
{
$locales = [];
foreach ($this->getLocalesFiles($prefix) as $file) {
$locales[] = substr($file, strrpos($file, '/') + 1, -4);
}
return array_unique(array_merge($locales, array_keys($this->messages)));
}
/**
* Init messages language from matching file in Lang directory.
*
* @param string $locale
*
* @return bool
*/
protected function loadMessagesFromFile($locale)
{
if (isset($this->messages[$locale])) {
return true;
}
return $this->resetMessages($locale);
}
/**
* Set messages of a locale and take file first if present.
*
* @param string $locale
* @param array $messages
*
* @return $this
*/
public function setMessages($locale, $messages)
{
$this->loadMessagesFromFile($locale);
$this->addResource('array', $messages, $locale);
$this->messages[$locale] = array_merge(
isset($this->messages[$locale]) ? $this->messages[$locale] : [],
$messages
);
return $this;
}
/**
* Get messages of a locale, if none given, return all the
* languages.
*
* @param string|null $locale
*
* @return array
*/
public function getMessages($locale = null)
{
return $locale === null ? $this->messages : $this->messages[$locale];
}
/**
* Set the current translator locale and indicate if the source locale file exists
*
* @param string $locale locale ex. en
*
* @return bool
*/
public function setLocale($locale)
{
$locale = preg_replace_callback('/[-_]([a-z]{2,})/', function ($matches) {
// _2-letters is a region, _3+-letters is a variant
return '_'.call_user_func(strlen($matches[1]) > 2 ? 'ucfirst' : 'strtoupper', $matches[1]);
}, strtolower($locale));
if ($this->getLocale() === $locale) {
return true;
}
if ($locale === 'auto') {
$completeLocale = setlocale(LC_TIME, 0);
$locale = preg_replace('/^([^_.-]+).*$/', '$1', $completeLocale);
$locales = $this->getAvailableLocales($locale);
$completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale);
$getScore = function ($language) use ($completeLocaleChunks) {
$chunks = preg_split('/[_.-]+/', $language);
$score = 0;
foreach ($completeLocaleChunks as $index => $chunk) {
if (!isset($chunks[$index])) {
$score++;
continue;
}
if (strtolower($chunks[$index]) === strtolower($chunk)) {
$score += 10;
}
}
return $score;
};
usort($locales, function ($a, $b) use ($getScore) {
$a = $getScore($a);
$b = $getScore($b);
if ($a === $b) {
return 0;
}
return $a < $b ? 1 : -1;
});
$locale = $locales[0];
}
// If subtag (ex: en_CA) first load the macro (ex: en) to have a fallback
if (strpos($locale, '_') !== false) {
if ($this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale))) {
parent::setLocale($macroLocale);
}
}
if ($this->loadMessagesFromFile($locale)) {
parent::setLocale($locale);
return true;
}
return false;
}
}
src/JsonSerializable.php 0000644 00000000776 15014555553 0011326 0 ustar 00 json_encode,
* which is a value of any type other than a resource.
*
* @since 5.4.0
*/
public function jsonSerialize();
}
}