chore: restore vendor directory dependencies
This commit is contained in:
BIN
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
BIN
Binary file not shown.
BIN
Binary file not shown.
|
After Width: | Height: | Size: 245 KiB |
Binary file not shown.
BIN
Binary file not shown.
|
After Width: | Height: | Size: 210 KiB |
BIN
Binary file not shown.
BIN
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
BIN
Binary file not shown.
+56
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YYYY',
|
||||
],
|
||||
'months' => ['Janueri', 'Februeri', 'Mas', 'Epril', 'Me', 'Jun', 'Julai', 'Ogas', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'],
|
||||
'months_short' => ['Jan', 'Feb', 'Mas', 'Epr', 'Me', 'Jun', 'Jul', 'Oga', 'Sep', 'Okt', 'Nov', 'Des'],
|
||||
'weekdays' => ['Sande', 'Mande', 'Tunde', 'Trinde', 'Fonde', 'Fraide', 'Sarere'],
|
||||
'weekdays_short' => ['San', 'Man', 'Tun', 'Tri', 'Fon', 'Fra', 'Sar'],
|
||||
'weekdays_min' => ['San', 'Man', 'Tun', 'Tri', 'Fon', 'Fra', 'Sar'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'meridiem' => ['biknait', 'apinun'],
|
||||
|
||||
'year' => 'yia :count',
|
||||
'y' => 'yia :count',
|
||||
'a_year' => 'yia :count',
|
||||
|
||||
'month' => ':count mun',
|
||||
'm' => ':count mun',
|
||||
'a_month' => ':count mun',
|
||||
|
||||
'week' => ':count wik',
|
||||
'w' => ':count wik',
|
||||
'a_week' => ':count wik',
|
||||
|
||||
'day' => ':count de',
|
||||
'd' => ':count de',
|
||||
'a_day' => ':count de',
|
||||
|
||||
'hour' => ':count aua',
|
||||
'h' => ':count aua',
|
||||
'a_hour' => ':count aua',
|
||||
|
||||
'minute' => ':count minit',
|
||||
'min' => ':count minit',
|
||||
'a_minute' => ':count minit',
|
||||
|
||||
'second' => ':count namba tu',
|
||||
's' => ':count namba tu',
|
||||
'a_second' => ':count namba tu',
|
||||
]);
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Josh Soref
|
||||
* - Alan Agius
|
||||
* - Erhan Gundogan
|
||||
* - François B
|
||||
* - JD Isaacks
|
||||
* - Murat Yüksel
|
||||
* - Baran Şengül
|
||||
* - Selami (selamialtin)
|
||||
* - TeomanBey
|
||||
*/
|
||||
return [
|
||||
'year' => ':count yıl',
|
||||
'a_year' => '{1}bir yıl|]1,Inf[:count yıl',
|
||||
'y' => ':county',
|
||||
'month' => ':count ay',
|
||||
'a_month' => '{1}bir ay|]1,Inf[:count ay',
|
||||
'm' => ':countay',
|
||||
'week' => ':count hafta',
|
||||
'a_week' => '{1}bir hafta|]1,Inf[:count hafta',
|
||||
'w' => ':counth',
|
||||
'day' => ':count gün',
|
||||
'a_day' => '{1}bir gün|]1,Inf[:count gün',
|
||||
'd' => ':countg',
|
||||
'hour' => ':count saat',
|
||||
'a_hour' => '{1}bir saat|]1,Inf[:count saat',
|
||||
'h' => ':countsa',
|
||||
'minute' => ':count dakika',
|
||||
'a_minute' => '{1}bir dakika|]1,Inf[:count dakika',
|
||||
'min' => ':countdk',
|
||||
'second' => ':count saniye',
|
||||
'a_second' => '{1}birkaç saniye|]1,Inf[:count saniye',
|
||||
's' => ':countsn',
|
||||
'ago' => ':time önce',
|
||||
'from_now' => ':time sonra',
|
||||
'after' => ':time sonra',
|
||||
'before' => ':time önce',
|
||||
'diff_now' => 'şimdi',
|
||||
'diff_today' => 'bugün',
|
||||
'diff_today_regexp' => 'bugün(?:\\s+saat)?',
|
||||
'diff_yesterday' => 'dün',
|
||||
'diff_tomorrow' => 'yarın',
|
||||
'diff_tomorrow_regexp' => 'yarın(?:\\s+saat)?',
|
||||
'diff_before_yesterday' => 'evvelsi gün',
|
||||
'diff_after_tomorrow' => 'öbür gün',
|
||||
'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' => static 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' => ['ÖÖ', 'Ö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,
|
||||
'list' => [', ', ' ve '],
|
||||
];
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/tr.php', [
|
||||
'weekdays_short' => ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'],
|
||||
'weekdays_min' => ['Pa', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
|
||||
'formats' => [
|
||||
'LT' => 'h:mm a',
|
||||
'LTS' => 'h:mm:ss a',
|
||||
'L' => 'D.MM.YYYY',
|
||||
'LL' => 'D MMM YYYY',
|
||||
'LLL' => 'D MMMM YYYY h:mm a',
|
||||
'LLLL' => 'D MMMM YYYY dddd h:mm a',
|
||||
],
|
||||
]);
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/tr.php';
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/ts_ZA.php';
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YYYY',
|
||||
],
|
||||
'months' => ['Sunguti', 'Nyenyenyani', 'Nyenyankulu', 'Dzivamisoko', 'Mudyaxihi', 'Khotavuxika', 'Mawuwani', 'Mhawuri', 'Ndzhati', 'Nhlangula', 'Hukuri', 'N\'wendzamhala'],
|
||||
'months_short' => ['Sun', 'Yan', 'Kul', 'Dzi', 'Mud', 'Kho', 'Maw', 'Mha', 'Ndz', 'Nhl', 'Huk', 'N\'w'],
|
||||
'weekdays' => ['Sonto', 'Musumbhunuku', 'Ravumbirhi', 'Ravunharhu', 'Ravumune', 'Ravuntlhanu', 'Mugqivela'],
|
||||
'weekdays_short' => ['Son', 'Mus', 'Bir', 'Har', 'Ne', 'Tlh', 'Mug'],
|
||||
'weekdays_min' => ['Son', 'Mus', 'Bir', 'Har', 'Ne', 'Tlh', 'Mug'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
|
||||
'year' => 'malembe ya :count',
|
||||
'y' => 'malembe ya :count',
|
||||
'a_year' => 'malembe ya :count',
|
||||
|
||||
'month' => 'tin’hweti ta :count',
|
||||
'm' => 'tin’hweti ta :count',
|
||||
'a_month' => 'tin’hweti ta :count',
|
||||
|
||||
'week' => 'mavhiki ya :count',
|
||||
'w' => 'mavhiki ya :count',
|
||||
'a_week' => 'mavhiki ya :count',
|
||||
|
||||
'day' => 'masiku :count',
|
||||
'd' => 'masiku :count',
|
||||
'a_day' => 'masiku :count',
|
||||
|
||||
'hour' => 'tiawara ta :count',
|
||||
'h' => 'tiawara ta :count',
|
||||
'a_hour' => 'tiawara ta :count',
|
||||
|
||||
'minute' => 'timinete ta :count',
|
||||
'min' => 'timinete ta :count',
|
||||
'a_minute' => 'timinete ta :count',
|
||||
|
||||
'second' => 'tisekoni ta :count',
|
||||
's' => 'tisekoni ta :count',
|
||||
'a_second' => 'tisekoni ta :count',
|
||||
]);
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/tt_RU.php';
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Rinat Norkin Pablo Saratxaga, Rinat Norkin pablo@mandrakesoft.com, rinat@taif.ru
|
||||
*/
|
||||
return [
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'DD.MM.YYYY',
|
||||
'LL' => 'D MMMM YYYY',
|
||||
'LLL' => 'DD MMM, HH:mm',
|
||||
'LLLL' => 'DD MMMM YYYY, HH:mm',
|
||||
],
|
||||
'months' => ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'],
|
||||
'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'],
|
||||
'weekdays' => ['якшәмбе', 'дышәмбе', 'сишәмбе', 'чәршәәмбе', 'пәнҗешмбе', 'җомга', 'шимбә'],
|
||||
'weekdays_short' => ['якш', 'дыш', 'сиш', 'чәрш', 'пәнҗ', 'җом', 'шим'],
|
||||
'weekdays_min' => ['якш', 'дыш', 'сиш', 'чәрш', 'пәнҗ', 'җом', 'шим'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'year' => ':count ел',
|
||||
'month' => ':count ай',
|
||||
'week' => ':count атна',
|
||||
'day' => ':count көн',
|
||||
'hour' => ':count сәгать',
|
||||
'minute' => ':count минут',
|
||||
'second' => ':count секунд',
|
||||
];
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Reshat Sabiq tatar.iqtelif.i18n@gmail.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD.MM.YYYY',
|
||||
],
|
||||
'months' => ['Ğınwar', 'Fiwral\'', 'Mart', 'April', 'May', 'Yün', 'Yül', 'Awgust', 'Sintebír', 'Üktebír', 'Noyebír', 'Dikebír'],
|
||||
'months_short' => ['Ğın', 'Fiw', 'Mar', 'Apr', 'May', 'Yün', 'Yül', 'Awg', 'Sin', 'Ükt', 'Noy', 'Dik'],
|
||||
'weekdays' => ['Yekşembí', 'Düşembí', 'Sişembí', 'Çerşembí', 'Pencíşembí', 'Comğa', 'Şimbe'],
|
||||
'weekdays_short' => ['Yek', 'Düş', 'Siş', 'Çer', 'Pen', 'Com', 'Şim'],
|
||||
'weekdays_min' => ['Yek', 'Düş', 'Siş', 'Çer', 'Pen', 'Com', 'Şim'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'meridiem' => ['ÖA', 'ÖS'],
|
||||
]);
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/ses.php', [
|
||||
'meridiem' => ['Subbaahi', 'Zaarikay b'],
|
||||
]);
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return [
|
||||
'year' => '[0,1]:count ar|:count ars',
|
||||
'y' => '[0,1]:count ar|:count ars',
|
||||
'month' => '[0,1]:count mes|:count mesen',
|
||||
'm' => '[0,1]:count mes|:count mesen',
|
||||
'week' => '[0,1]:count seifetziua|:count seifetziuas',
|
||||
'w' => '[0,1]:count seifetziua|:count seifetziuas',
|
||||
'day' => '[0,1]:count ziua|:count ziuas',
|
||||
'd' => '[0,1]:count ziua|:count ziuas',
|
||||
'hour' => '[0,1]:count þora|:count þoras',
|
||||
'h' => '[0,1]:count þora|:count þoras',
|
||||
'minute' => '[0,1]:count míut|:count míuts',
|
||||
'min' => '[0,1]:count míut|:count míuts',
|
||||
'second' => ':count secunds',
|
||||
's' => ':count secunds',
|
||||
|
||||
'ago' => 'ja :time',
|
||||
'from_now' => 'osprei :time',
|
||||
|
||||
'diff_yesterday' => 'ieiri',
|
||||
'diff_yesterday_regexp' => 'ieiri(?:\\s+à)?',
|
||||
'diff_today' => 'oxhi',
|
||||
'diff_today_regexp' => 'oxhi(?:\\s+à)?',
|
||||
'diff_tomorrow' => 'demà',
|
||||
'diff_tomorrow_regexp' => 'demà(?:\\s+à)?',
|
||||
|
||||
'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' => ["D'A", "D'O"],
|
||||
'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,
|
||||
];
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Josh Soref
|
||||
* - JD Isaacks
|
||||
*/
|
||||
return [
|
||||
'year' => '{1}ⴰⵙⴳⴰⵙ|:count ⵉⵙⴳⴰⵙⵏ',
|
||||
'month' => '{1}ⴰⵢoⵓⵔ|:count ⵉⵢⵢⵉⵔⵏ',
|
||||
'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ',
|
||||
'day' => '{1}ⴰⵙⵙ|:count oⵙⵙⴰⵏ',
|
||||
'hour' => '{1}ⵙⴰⵄⴰ|:count ⵜⴰⵙⵙⴰⵄⵉⵏ',
|
||||
'minute' => '{1}ⵎⵉⵏⵓⴺ|:count ⵎⵉⵏⵓⴺ',
|
||||
'second' => '{1}ⵉⵎⵉⴽ|:count ⵉⵎⵉⴽ',
|
||||
'ago' => 'ⵢⴰⵏ :time',
|
||||
'from_now' => 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ :time',
|
||||
'diff_today' => 'ⴰⵙⴷⵅ',
|
||||
'diff_yesterday' => 'ⴰⵚⴰⵏⵜ',
|
||||
'diff_yesterday_regexp' => 'ⴰⵚⴰⵏⵜ(?:\\s+ⴴ)?',
|
||||
'diff_tomorrow' => 'ⴰⵙⴽⴰ',
|
||||
'diff_tomorrow_regexp' => 'ⴰⵙⴽⴰ(?:\\s+ⴴ)?',
|
||||
'diff_today_regexp' => 'ⴰⵙⴷⵅ(?:\\s+ⴴ)?',
|
||||
'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,
|
||||
'weekend' => [5, 6],
|
||||
];
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Josh Soref
|
||||
* - JD Isaacks
|
||||
*/
|
||||
return [
|
||||
'year' => '{1}:count asgas|:count isgasn',
|
||||
'a_year' => 'asgas|:count isgasn',
|
||||
'month' => '{1}:count ayowr|:count iyyirn',
|
||||
'a_month' => 'ayowr|:count iyyirn',
|
||||
'week' => ':count imalass',
|
||||
'a_week' => ':imalass',
|
||||
'day' => '{1}:count ass|:count ossan',
|
||||
'a_day' => 'ass|:count ossan',
|
||||
'hour' => '{1}:count saɛa|:count tassaɛin',
|
||||
'a_hour' => '{1}saɛa|:count tassaɛin',
|
||||
'minute' => ':count minuḍ',
|
||||
'a_minute' => '{1}minuḍ|:count minuḍ',
|
||||
'second' => ':count imik',
|
||||
'a_second' => '{1}imik|:count imik',
|
||||
'ago' => 'yan :time',
|
||||
'from_now' => 'dadkh s yan :time',
|
||||
'diff_yesterday' => 'assant',
|
||||
'diff_yesterday_regexp' => 'assant(?:\\s+g)?',
|
||||
'diff_today' => 'asdkh',
|
||||
'diff_today_regexp' => 'asdkh(?:\\s+g)?',
|
||||
'diff_tomorrow' => 'aska',
|
||||
'diff_tomorrow_regexp' => 'aska(?:\\s+g)?',
|
||||
'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'],
|
||||
'meridiem' => ['Zdat azal', 'Ḍeffir aza'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
];
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Philippe Vaucher
|
||||
* - Tsutomu Kuroda
|
||||
* - yasinn
|
||||
*/
|
||||
return [
|
||||
'year' => '{1}'.'بىر يىل'.'|:count '.'يىل',
|
||||
'month' => '{1}'.'بىر ئاي'.'|:count '.'ئاي',
|
||||
'week' => '{1}'.'بىر ھەپتە'.'|:count '.'ھەپتە',
|
||||
'day' => '{1}'.'بىر كۈن'.'|:count '.'كۈن',
|
||||
'hour' => '{1}'.'بىر سائەت'.'|:count '.'سائەت',
|
||||
'minute' => '{1}'.'بىر مىنۇت'.'|:count '.'مىنۇت',
|
||||
'second' => '{1}'.'نەچچە سېكونت'.'|:count '.'سېكونت',
|
||||
'ago' => ':time بۇرۇن',
|
||||
'from_now' => ':time كېيىن',
|
||||
'diff_today' => 'بۈگۈن',
|
||||
'diff_yesterday' => 'تۆنۈگۈن',
|
||||
'diff_tomorrow' => 'ئەتە',
|
||||
'diff_tomorrow_regexp' => 'ئەتە(?:\\s+سائەت)?',
|
||||
'diff_today_regexp' => 'بۈگۈن(?:\\s+سائەت)?',
|
||||
'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' => static function ($number, $period) {
|
||||
return match ($period) {
|
||||
'd', 'D', 'DDD' => $number.'-كۈنى',
|
||||
'w', 'W' => $number.'-ھەپتە',
|
||||
default => $number,
|
||||
};
|
||||
},
|
||||
'meridiem' => static function ($hour, $minute) {
|
||||
$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,
|
||||
'list' => [', ', ' ۋە '],
|
||||
];
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Kunal Marwaha
|
||||
* - Alim Boyaq
|
||||
*/
|
||||
return require __DIR__.'/ug.php';
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
|
||||
$processHoursFunction = static function (CarbonInterface $date, string $format) {
|
||||
return $format.'о'.($date->hour === 11 ? 'б' : '').'] LT';
|
||||
};
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Kunal Marwaha
|
||||
* - Josh Soref
|
||||
* - François B
|
||||
* - Tim Fish
|
||||
* - Serhan Apaydın
|
||||
* - Max Mykhailenko
|
||||
* - JD Isaacks
|
||||
* - Max Kovpak
|
||||
* - AucT
|
||||
* - Philippe Vaucher
|
||||
* - Ilya Shaplyko
|
||||
* - Vadym Ievsieiev
|
||||
* - Denys Kurets
|
||||
* - Igor Kasyanchuk
|
||||
* - Tsutomu Kuroda
|
||||
* - tjku
|
||||
* - Max Melentiev
|
||||
* - Oleh
|
||||
* - epaminond
|
||||
* - Juanito Fatas
|
||||
* - Vitalii Khustochka
|
||||
* - Akira Matsuda
|
||||
* - Christopher Dell
|
||||
* - Enrique Vidal
|
||||
* - Simone Carletti
|
||||
* - Aaron Patterson
|
||||
* - Andriy Tyurnikov
|
||||
* - Nicolás Hock Isaza
|
||||
* - Iwakura Taro
|
||||
* - Andrii Ponomarov
|
||||
* - alecrabbit
|
||||
* - vystepanenko
|
||||
* - AlexWalkerson
|
||||
* - Andre Havryliuk (Andrend)
|
||||
* - Max Datsenko (datsenko-md)
|
||||
*/
|
||||
return [
|
||||
'year' => ':count рік|:count роки|:count років',
|
||||
'y' => ':countр|:countрр|:countрр',
|
||||
'a_year' => '{1}рік|:count рік|:count роки|:count років',
|
||||
'month' => ':count місяць|:count місяці|:count місяців',
|
||||
'm' => ':countм',
|
||||
'a_month' => '{1}місяць|:count місяць|:count місяці|:count місяців',
|
||||
'week' => ':count тиждень|:count тижні|:count тижнів',
|
||||
'w' => ':countт',
|
||||
'a_week' => '{1}тиждень|:count тиждень|:count тижні|:count тижнів',
|
||||
'day' => ':count день|:count дні|:count днів',
|
||||
'd' => ':countд',
|
||||
'a_day' => '{1}день|:count день|:count дні|:count днів',
|
||||
'hour' => ':count година|:count години|:count годин',
|
||||
'h' => ':countг',
|
||||
'a_hour' => '{1}година|:count година|:count години|:count годин',
|
||||
'minute' => ':count хвилина|:count хвилини|:count хвилин',
|
||||
'min' => ':countхв',
|
||||
'a_minute' => '{1}хвилина|:count хвилина|:count хвилини|:count хвилин',
|
||||
'second' => ':count секунда|:count секунди|:count секунд',
|
||||
's' => ':countсек',
|
||||
'a_second' => '{1}декілька секунд|:count секунда|:count секунди|:count секунд',
|
||||
|
||||
'hour_ago' => ':count годину|:count години|:count годин',
|
||||
'a_hour_ago' => '{1}годину|:count годину|:count години|:count годин',
|
||||
'minute_ago' => ':count хвилину|:count хвилини|:count хвилин',
|
||||
'a_minute_ago' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин',
|
||||
'second_ago' => ':count секунду|:count секунди|:count секунд',
|
||||
'a_second_ago' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд',
|
||||
|
||||
'hour_from_now' => ':count годину|:count години|:count годин',
|
||||
'a_hour_from_now' => '{1}годину|:count годину|:count години|:count годин',
|
||||
'minute_from_now' => ':count хвилину|:count хвилини|:count хвилин',
|
||||
'a_minute_from_now' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин',
|
||||
'second_from_now' => ':count секунду|:count секунди|:count секунд',
|
||||
'a_second_from_now' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд',
|
||||
|
||||
'hour_after' => ':count годину|:count години|:count годин',
|
||||
'a_hour_after' => '{1}годину|:count годину|:count години|:count годин',
|
||||
'minute_after' => ':count хвилину|:count хвилини|:count хвилин',
|
||||
'a_minute_after' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин',
|
||||
'second_after' => ':count секунду|:count секунди|:count секунд',
|
||||
'a_second_after' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд',
|
||||
|
||||
'hour_before' => ':count годину|:count години|:count годин',
|
||||
'a_hour_before' => '{1}годину|:count годину|:count години|:count годин',
|
||||
'minute_before' => ':count хвилину|:count хвилини|:count хвилин',
|
||||
'a_minute_before' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин',
|
||||
'second_before' => ':count секунду|:count секунди|:count секунд',
|
||||
'a_second_before' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд',
|
||||
|
||||
'ago' => ':time тому',
|
||||
'from_now' => 'за :time',
|
||||
'after' => ':time після',
|
||||
'before' => ':time до',
|
||||
'diff_now' => 'щойно',
|
||||
'diff_today' => 'Сьогодні',
|
||||
'diff_today_regexp' => 'Сьогодні(?:\\s+о)?',
|
||||
'diff_yesterday' => 'вчора',
|
||||
'diff_yesterday_regexp' => 'Вчора(?:\\s+о)?',
|
||||
'diff_tomorrow' => 'завтра',
|
||||
'diff_tomorrow_regexp' => 'Завтра(?:\\s+о)?',
|
||||
'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' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Сьогодні '),
|
||||
'nextDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Завтра '),
|
||||
'nextWeek' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[У] dddd ['),
|
||||
'lastDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Вчора '),
|
||||
'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
|
||||
0, 3, 5, 6 => $processHoursFunction($date, '[Минулої] dddd ['),
|
||||
default => $processHoursFunction($date, '[Минулого] dddd ['),
|
||||
},
|
||||
'sameElse' => 'L',
|
||||
],
|
||||
'ordinal' => static fn ($number, $period) => match ($period) {
|
||||
'M', 'd', 'DDD', 'w', 'W' => $number.'-й',
|
||||
'D' => $number.'-го',
|
||||
default => $number,
|
||||
},
|
||||
'meridiem' => static function ($hour) {
|
||||
if ($hour < 4) {
|
||||
return 'ночі';
|
||||
}
|
||||
|
||||
if ($hour < 12) {
|
||||
return 'ранку';
|
||||
}
|
||||
|
||||
if ($hour < 17) {
|
||||
return 'дня';
|
||||
}
|
||||
|
||||
return 'вечора';
|
||||
},
|
||||
'months' => ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'],
|
||||
'months_standalone' => ['січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'],
|
||||
'months_short' => ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру'],
|
||||
'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/',
|
||||
'weekdays' => static function (CarbonInterface $date, $format, $index) {
|
||||
static $words = [
|
||||
'nominative' => ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'],
|
||||
'accusative' => ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'],
|
||||
'genitive' => ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи'],
|
||||
];
|
||||
|
||||
$format ??= '';
|
||||
$nounCase = preg_match('/(\[(В|в|У|у)\])\s+dddd/u', $format)
|
||||
? 'accusative'
|
||||
: (
|
||||
preg_match('/\[?(?:минулої|наступної)?\s*\]\s+dddd/u', $format)
|
||||
? 'genitive'
|
||||
: 'nominative'
|
||||
);
|
||||
|
||||
return $words[$nounCase][$index] ?? null;
|
||||
},
|
||||
'weekdays_short' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
|
||||
'weekdays_min' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'list' => [', ', ' i '],
|
||||
];
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/uk.php';
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/unm_US.php';
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - bug-glibc-locales@gnu.org
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YY',
|
||||
],
|
||||
'months' => ['enikwsi', 'chkwali', 'xamokhwite', 'kwetayoxe', 'tainipen', 'kichinipen', 'lainipen', 'winaminke', 'kichitahkok', 'puksit', 'wini', 'muxkotae'],
|
||||
'months_short' => ['eni', 'chk', 'xam', 'kwe', 'tai', 'nip', 'lai', 'win', 'tah', 'puk', 'kun', 'mux'],
|
||||
'weekdays' => ['kentuwei', 'manteke', 'tusteke', 'lelai', 'tasteke', 'pelaiteke', 'sateteke'],
|
||||
'weekdays_short' => ['ken', 'man', 'tus', 'lel', 'tas', 'pel', 'sat'],
|
||||
'weekdays_min' => ['ken', 'man', 'tus', 'lel', 'tas', 'pel', 'sat'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
|
||||
// Too unreliable
|
||||
/*
|
||||
'year' => ':count kaxtëne',
|
||||
'y' => ':count kaxtëne',
|
||||
'a_year' => ':count kaxtëne',
|
||||
|
||||
'month' => ':count piskewëni kishux', // less reliable
|
||||
'm' => ':count piskewëni kishux', // less reliable
|
||||
'a_month' => ':count piskewëni kishux', // less reliable
|
||||
|
||||
'week' => ':count kishku', // less reliable
|
||||
'w' => ':count kishku', // less reliable
|
||||
'a_week' => ':count kishku', // less reliable
|
||||
|
||||
'day' => ':count kishku',
|
||||
'd' => ':count kishku',
|
||||
'a_day' => ':count kishku',
|
||||
|
||||
'hour' => ':count xkuk', // less reliable
|
||||
'h' => ':count xkuk', // less reliable
|
||||
'a_hour' => ':count xkuk', // less reliable
|
||||
|
||||
'minute' => ':count txituwàk', // less reliable
|
||||
'min' => ':count txituwàk', // less reliable
|
||||
'a_minute' => ':count txituwàk', // less reliable
|
||||
|
||||
'second' => ':count nisha', // less reliable
|
||||
's' => ':count nisha', // less reliable
|
||||
'a_second' => ':count nisha', // less reliable
|
||||
*/
|
||||
]);
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
$months = [
|
||||
'جنوری',
|
||||
'فروری',
|
||||
'مارچ',
|
||||
'اپریل',
|
||||
'مئی',
|
||||
'جون',
|
||||
'جولائی',
|
||||
'اگست',
|
||||
'ستمبر',
|
||||
'اکتوبر',
|
||||
'نومبر',
|
||||
'دسمبر',
|
||||
];
|
||||
|
||||
$weekdays = [
|
||||
'اتوار',
|
||||
'پیر',
|
||||
'منگل',
|
||||
'بدھ',
|
||||
'جمعرات',
|
||||
'جمعہ',
|
||||
'ہفتہ',
|
||||
];
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Sawood Alam
|
||||
* - Mehshan
|
||||
* - Philippe Vaucher
|
||||
* - Tsutomu Kuroda
|
||||
* - tjku
|
||||
* - Zaid Akram
|
||||
* - Max Melentiev
|
||||
* - hafezdivandari
|
||||
* - Hossein Jabbari
|
||||
* - nimamo
|
||||
*/
|
||||
return [
|
||||
'year' => 'ایک سال|:count سال',
|
||||
'month' => 'ایک ماہ|:count ماہ',
|
||||
'week' => ':count ہفتے',
|
||||
'day' => 'ایک دن|:count دن',
|
||||
'hour' => 'ایک گھنٹہ|:count گھنٹے',
|
||||
'minute' => 'ایک منٹ|:count منٹ',
|
||||
'second' => 'چند سیکنڈ|:count سیکنڈ',
|
||||
'ago' => ':time قبل',
|
||||
'from_now' => ':time بعد',
|
||||
'after' => ':time بعد',
|
||||
'before' => ':time پہلے',
|
||||
'diff_now' => 'اب',
|
||||
'diff_today' => 'آج',
|
||||
'diff_today_regexp' => 'آج(?:\\s+بوقت)?',
|
||||
'diff_yesterday' => 'گزشتہ کل',
|
||||
'diff_yesterday_regexp' => 'گذشتہ(?:\\s+روز)?(?:\\s+بوقت)?',
|
||||
'diff_tomorrow' => 'آئندہ کل',
|
||||
'diff_tomorrow_regexp' => 'کل(?:\\s+بوقت)?',
|
||||
'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' => ['صبح', 'شام'],
|
||||
'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,
|
||||
'list' => ['، ', ' اور '],
|
||||
];
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Red Hat, Pune bug-glibc-locales@gnu.org
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ur.php', [
|
||||
'formats' => [
|
||||
'L' => 'D/M/YY',
|
||||
],
|
||||
'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'],
|
||||
'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'],
|
||||
'weekdays' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'],
|
||||
'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'],
|
||||
'weekdays_min' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'],
|
||||
'day_of_first_week_of_year' => 1,
|
||||
]);
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - bug-glibc-locales@gnu.org
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ur.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YYYY',
|
||||
],
|
||||
'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'],
|
||||
'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'],
|
||||
'weekdays' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'],
|
||||
'weekdays_short' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'],
|
||||
'weekdays_min' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'],
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'meridiem' => ['ص', 'ش'],
|
||||
]);
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Dmitriy Shabanov
|
||||
* - JD Isaacks
|
||||
* - Inoyatulloh
|
||||
* - Jamshid
|
||||
* - aarkhipov
|
||||
* - Philippe Vaucher
|
||||
* - felixthemagnificent
|
||||
* - Tsutomu Kuroda
|
||||
* - tjku
|
||||
* - Max Melentiev
|
||||
* - Juanito Fatas
|
||||
* - Alisher Ulugbekov
|
||||
* - Ergashev Adizbek
|
||||
*/
|
||||
return [
|
||||
'year' => ':count йил',
|
||||
'a_year' => '{1}бир йил|:count йил',
|
||||
'y' => ':count й',
|
||||
'month' => ':count ой',
|
||||
'a_month' => '{1}бир ой|:count ой',
|
||||
'm' => ':count о',
|
||||
'week' => ':count ҳафта',
|
||||
'a_week' => '{1}бир ҳафта|:count ҳафта',
|
||||
'w' => ':count ҳ',
|
||||
'day' => ':count кун',
|
||||
'a_day' => '{1}бир кун|:count кун',
|
||||
'd' => ':count к',
|
||||
'hour' => ':count соат',
|
||||
'a_hour' => '{1}бир соат|:count соат',
|
||||
'h' => ':count с',
|
||||
'minute' => ':count дақиқа',
|
||||
'a_minute' => '{1}бир дақиқа|:count дақиқа',
|
||||
'min' => ':count д',
|
||||
'second' => ':count сония',
|
||||
'a_second' => '{1}сония|:count сония',
|
||||
's' => ':count с',
|
||||
'ago' => ':time аввал',
|
||||
'from_now' => 'Якин :time ичида',
|
||||
'after' => ':timeдан кейин',
|
||||
'before' => ':time олдин',
|
||||
'diff_now' => 'ҳозир',
|
||||
'diff_today' => 'Бугун',
|
||||
'diff_today_regexp' => 'Бугун(?:\\s+соат)?',
|
||||
'diff_yesterday' => 'Кеча',
|
||||
'diff_yesterday_regexp' => 'Кеча(?:\\s+соат)?',
|
||||
'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,
|
||||
'meridiem' => ['эрталаб', 'кечаси'],
|
||||
'list' => [', ', ' ва '],
|
||||
];
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/fa.php', [
|
||||
'weekdays' => ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'],
|
||||
'weekdays_short' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'],
|
||||
'weekdays_min' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'],
|
||||
'months' => ['جنوری', 'فبروری', 'مارچ', 'اپریل', 'می', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'],
|
||||
'months_short' => ['جنو', 'فبر', 'مار', 'اپر', 'می', 'جون', 'جول', 'اگس', 'سپت', 'اکت', 'نوم', 'دسم'],
|
||||
'first_day_of_week' => 6,
|
||||
'weekend' => [4, 5],
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'YYYY-MM-dd',
|
||||
'LL' => 'YYYY MMM D',
|
||||
'LLL' => 'YYYY MMMM D HH:mm',
|
||||
'LLLL' => 'YYYY MMMM D, dddd HH:mm',
|
||||
],
|
||||
]);
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/uz.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/yy',
|
||||
'LL' => 'D MMM, YYYY',
|
||||
'LLL' => 'D MMMM, YYYY HH:mm',
|
||||
'LLLL' => 'dddd, DD MMMM, YYYY HH:mm',
|
||||
],
|
||||
'meridiem' => ['ТО', 'ТК'],
|
||||
]);
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Josh Soref
|
||||
* - Rasulbek
|
||||
* - Ilyosjon Kamoldinov (ilyosjon09)
|
||||
*/
|
||||
return [
|
||||
'year' => ':count yil',
|
||||
'a_year' => '{1}bir yil|:count yil',
|
||||
'y' => ':count y',
|
||||
'month' => ':count oy',
|
||||
'a_month' => '{1}bir oy|:count oy',
|
||||
'm' => ':count o',
|
||||
'week' => ':count hafta',
|
||||
'a_week' => '{1}bir hafta|:count hafta',
|
||||
'w' => ':count h',
|
||||
'day' => ':count kun',
|
||||
'a_day' => '{1}bir kun|:count kun',
|
||||
'd' => ':count k',
|
||||
'hour' => ':count soat',
|
||||
'a_hour' => '{1}bir soat|:count soat',
|
||||
'h' => ':count soat',
|
||||
'minute' => ':count daqiqa',
|
||||
'a_minute' => '{1}bir daqiqa|:count daqiqa',
|
||||
'min' => ':count d',
|
||||
'second' => ':count soniya',
|
||||
'a_second' => '{1}soniya|:count soniya',
|
||||
's' => ':count son.',
|
||||
'ago' => ':time avval',
|
||||
'from_now' => 'Yaqin :time ichida',
|
||||
'after' => ':timedan keyin',
|
||||
'before' => ':time oldin',
|
||||
'diff_yesterday' => 'Kecha',
|
||||
'diff_yesterday_regexp' => 'Kecha(?:\\s+soat)?',
|
||||
'diff_today' => 'Bugun',
|
||||
'diff_today_regexp' => 'Bugun(?:\\s+soat)?',
|
||||
'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,
|
||||
'list' => [', ', ' va '],
|
||||
'meridiem' => ['TO', 'TK'],
|
||||
];
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Bobir Ismailov Bobir Ismailov, Pablo Saratxaga, Mashrab Kuvatov bobir_is@yahoo.com, pablo@mandrakesoft.com, kmashrab@uni-bremen.de
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/uz_Latn.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YY',
|
||||
],
|
||||
'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr'],
|
||||
'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyn', 'Iyl', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'],
|
||||
'weekdays' => ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba'],
|
||||
'weekdays_short' => ['Yak', 'Du', 'Se', 'Cho', 'Pay', 'Ju', 'Sha'],
|
||||
'weekdays_min' => ['Yak', 'Du', 'Se', 'Cho', 'Pay', 'Ju', 'Sha'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
]);
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Mashrab Kuvatov Mashrab Kuvatov, Pablo Saratxaga kmashrab@uni-bremen.de, pablo@mandrakesoft.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/uz.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YY',
|
||||
],
|
||||
'months' => ['Январ', 'Феврал', 'Март', 'Апрел', 'Май', 'Июн', 'Июл', 'Август', 'Сентябр', 'Октябр', 'Ноябр', 'Декабр'],
|
||||
'months_short' => ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],
|
||||
'weekdays' => ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'],
|
||||
'weekdays_short' => ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'],
|
||||
'weekdays_min' => ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
]);
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'weekdays' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'],
|
||||
'weekdays_short' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'],
|
||||
'weekdays_min' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'],
|
||||
'months' => ['ꖨꖕ ꕪꕴ ꔞꔀꕮꕊ', 'ꕒꕡꖝꖕ', 'ꕾꖺ', 'ꖢꖕ', 'ꖑꕱ', 'ꖱꘋ', 'ꖱꕞꔤ', 'ꗛꔕ', 'ꕢꕌ', 'ꕭꖃ', 'ꔞꘋꕔꕿ ꕸꖃꗏ', 'ꖨꖕ ꕪꕴ ꗏꖺꕮꕊ'],
|
||||
'months_short' => ['ꖨꖕꔞ', 'ꕒꕡ', 'ꕾꖺ', 'ꖢꖕ', 'ꖑꕱ', 'ꖱꘋ', 'ꖱꕞ', 'ꗛꔕ', 'ꕢꕌ', 'ꕭꖃ', 'ꔞꘋ', 'ꖨꖕꗏ'],
|
||||
'first_day_of_week' => 1,
|
||||
'formats' => [
|
||||
'LT' => 'h:mm a',
|
||||
'LTS' => 'h:mm:ss a',
|
||||
'L' => 'DD/MM/YYYY',
|
||||
'LL' => 'D MMM YYYY',
|
||||
'LLL' => 'D MMMM YYYY h:mm a',
|
||||
'LLLL' => 'dddd, D MMMM YYYY h:mm a',
|
||||
],
|
||||
|
||||
'year' => ':count ꕀ', // less reliable
|
||||
'y' => ':count ꕀ', // less reliable
|
||||
'a_year' => ':count ꕀ', // less reliable
|
||||
|
||||
'second' => ':count ꗱꕞꕯꕊ', // less reliable
|
||||
's' => ':count ꗱꕞꕯꕊ', // less reliable
|
||||
'a_second' => ':count ꗱꕞꕯꕊ', // less reliable
|
||||
]);
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'weekdays' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'],
|
||||
'weekdays_short' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'],
|
||||
'weekdays_min' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'],
|
||||
'months' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'],
|
||||
'months_short' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'],
|
||||
'first_day_of_week' => 1,
|
||||
'formats' => [
|
||||
'LT' => 'h:mm a',
|
||||
'LTS' => 'h:mm:ss a',
|
||||
'L' => 'DD/MM/YYYY',
|
||||
'LL' => 'D MMM YYYY',
|
||||
'LLL' => 'D MMMM YYYY h:mm a',
|
||||
'LLLL' => 'dddd, D MMMM YYYY h:mm a',
|
||||
],
|
||||
]);
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/vai.php';
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/ve_ZA.php';
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YYYY',
|
||||
],
|
||||
'months' => ['Phando', 'Luhuhi', 'Ṱhafamuhwe', 'Lambamai', 'Shundunthule', 'Fulwi', 'Fulwana', 'Ṱhangule', 'Khubvumedzi', 'Tshimedzi', 'Ḽara', 'Nyendavhusiku'],
|
||||
'months_short' => ['Pha', 'Luh', 'Fam', 'Lam', 'Shu', 'Lwi', 'Lwa', 'Ngu', 'Khu', 'Tsh', 'Ḽar', 'Nye'],
|
||||
'weekdays' => ['Swondaha', 'Musumbuluwo', 'Ḽavhuvhili', 'Ḽavhuraru', 'Ḽavhuṋa', 'Ḽavhuṱanu', 'Mugivhela'],
|
||||
'weekdays_short' => ['Swo', 'Mus', 'Vhi', 'Rar', 'ṋa', 'Ṱan', 'Mug'],
|
||||
'weekdays_min' => ['Swo', 'Mus', 'Vhi', 'Rar', 'ṋa', 'Ṱan', 'Mug'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
|
||||
// Too unreliable
|
||||
/*
|
||||
'day' => ':count vhege', // less reliable
|
||||
'd' => ':count vhege', // less reliable
|
||||
'a_day' => ':count vhege', // less reliable
|
||||
|
||||
'hour' => ':count watshi', // less reliable
|
||||
'h' => ':count watshi', // less reliable
|
||||
'a_hour' => ':count watshi', // less reliable
|
||||
|
||||
'minute' => ':count watshi', // less reliable
|
||||
'min' => ':count watshi', // less reliable
|
||||
'a_minute' => ':count watshi', // less reliable
|
||||
|
||||
'second' => ':count Mu', // less reliable
|
||||
's' => ':count Mu', // less reliable
|
||||
'a_second' => ':count Mu', // less reliable
|
||||
|
||||
'week' => ':count vhege',
|
||||
'w' => ':count vhege',
|
||||
'a_week' => ':count vhege',
|
||||
*/
|
||||
]);
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - François B
|
||||
* - Andre Polykanine A.K.A. Menelion Elensúlë
|
||||
* - JD Isaacks
|
||||
*/
|
||||
return [
|
||||
'year' => ':count năm',
|
||||
'a_year' => '{1}một năm|]1, Inf[:count năm',
|
||||
'y' => ':count năm',
|
||||
'month' => ':count tháng',
|
||||
'a_month' => '{1}một tháng|]1, Inf[:count tháng',
|
||||
'm' => ':count tháng',
|
||||
'week' => ':count tuần',
|
||||
'a_week' => '{1}một tuần|]1, Inf[:count tuần',
|
||||
'w' => ':count tuần',
|
||||
'day' => ':count ngày',
|
||||
'a_day' => '{1}một ngày|]1, Inf[:count ngày',
|
||||
'd' => ':count ngày',
|
||||
'hour' => ':count giờ',
|
||||
'a_hour' => '{1}một giờ|]1, Inf[:count giờ',
|
||||
'h' => ':count giờ',
|
||||
'minute' => ':count phút',
|
||||
'a_minute' => '{1}một phút|]1, Inf[:count phút',
|
||||
'min' => ':count phút',
|
||||
'second' => ':count giây',
|
||||
'a_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',
|
||||
'diff_now' => 'bây giờ',
|
||||
'diff_today' => 'Hôm',
|
||||
'diff_today_regexp' => 'Hôm(?:\\s+nay)?(?:\\s+lúc)?',
|
||||
'diff_yesterday' => 'Hôm qua',
|
||||
'diff_yesterday_regexp' => 'Hôm(?:\\s+qua)?(?:\\s+lúc)?',
|
||||
'diff_tomorrow' => 'Ngày mai',
|
||||
'diff_tomorrow_regexp' => 'Ngày(?:\\s+mai)?(?:\\s+lú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 trước lúc] LT',
|
||||
'sameElse' => 'L',
|
||||
],
|
||||
'meridiem' => ['SA', 'CH'],
|
||||
'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,
|
||||
'list' => [', ', ' và '],
|
||||
];
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/vi.php';
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'],
|
||||
'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'],
|
||||
'first_day_of_week' => 1,
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'YYYY-MM-dd',
|
||||
'LL' => 'YYYY MMM D',
|
||||
'LLL' => 'YYYY MMMM D HH:mm',
|
||||
'LLLL' => 'YYYY MMMM D, dddd HH:mm',
|
||||
],
|
||||
|
||||
'year' => ':count yel',
|
||||
'y' => ':count yel',
|
||||
'a_year' => ':count yel',
|
||||
|
||||
'month' => ':count mul',
|
||||
'm' => ':count mul',
|
||||
'a_month' => ':count mul',
|
||||
|
||||
'week' => ':count vig',
|
||||
'w' => ':count vig',
|
||||
'a_week' => ':count vig',
|
||||
|
||||
'day' => ':count del',
|
||||
'd' => ':count del',
|
||||
'a_day' => ':count del',
|
||||
|
||||
'hour' => ':count düp',
|
||||
'h' => ':count düp',
|
||||
'a_hour' => ':count düp',
|
||||
|
||||
'minute' => ':count minut',
|
||||
'min' => ':count minut',
|
||||
'a_minute' => ':count minut',
|
||||
|
||||
'second' => ':count sekun',
|
||||
's' => ':count sekun',
|
||||
'a_second' => ':count sekun',
|
||||
]);
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'meridiem' => ['utuko', 'kyiukonyi'],
|
||||
'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'],
|
||||
'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'],
|
||||
'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'],
|
||||
'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'],
|
||||
'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'],
|
||||
'first_day_of_week' => 1,
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'DD/MM/YYYY',
|
||||
'LL' => 'D MMM YYYY',
|
||||
'LLL' => 'D MMMM YYYY HH:mm',
|
||||
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
|
||||
],
|
||||
]);
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/wa_BE.php';
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Djan SACRE Pablo Saratxaga pablo@mandrakesoft.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YYYY',
|
||||
],
|
||||
'months' => ['di djanvî', 'di fevrî', 'di måss', 'd’ avri', 'di may', 'di djun', 'di djulete', 'd’ awousse', 'di setimbe', 'd’ octôbe', 'di nôvimbe', 'di decimbe'],
|
||||
'months_short' => ['dja', 'fev', 'mås', 'avr', 'may', 'djn', 'djl', 'awo', 'set', 'oct', 'nôv', 'dec'],
|
||||
'weekdays' => ['dimegne', 'londi', 'mårdi', 'mierkidi', 'djudi', 'vénrdi', 'semdi'],
|
||||
'weekdays_short' => ['dim', 'lon', 'mår', 'mie', 'dju', 'vén', 'sem'],
|
||||
'weekdays_min' => ['dim', 'lon', 'mår', 'mie', 'dju', 'vén', 'sem'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 4,
|
||||
|
||||
'year' => ':count anêye',
|
||||
'y' => ':count anêye',
|
||||
'a_year' => ':count anêye',
|
||||
|
||||
'month' => ':count meûs',
|
||||
'm' => ':count meûs',
|
||||
'a_month' => ':count meûs',
|
||||
|
||||
'week' => ':count samwinne',
|
||||
'w' => ':count samwinne',
|
||||
'a_week' => ':count samwinne',
|
||||
|
||||
'day' => ':count djoû',
|
||||
'd' => ':count djoû',
|
||||
'a_day' => ':count djoû',
|
||||
|
||||
'hour' => ':count eure',
|
||||
'h' => ':count eure',
|
||||
'a_hour' => ':count eure',
|
||||
|
||||
'minute' => ':count munute',
|
||||
'min' => ':count munute',
|
||||
'a_minute' => ':count munute',
|
||||
|
||||
'second' => ':count Sigonde',
|
||||
's' => ':count Sigonde',
|
||||
'a_second' => ':count Sigonde',
|
||||
]);
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/wae_CH.php';
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Walser Translation Team ml@translate-wae.ch
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'YYYY-MM-DD',
|
||||
],
|
||||
'months' => ['Jenner', 'Hornig', 'Märze', 'Abrille', 'Meije', 'Bráčet', 'Heiwet', 'Öigšte', 'Herbštmánet', 'Wímánet', 'Wintermánet', 'Chrištmánet'],
|
||||
'months_short' => ['Jen', 'Hor', 'Mär', 'Abr', 'Mei', 'Brá', 'Hei', 'Öig', 'Her', 'Wím', 'Win', 'Chr'],
|
||||
'weekdays' => ['Suntag', 'Mäntag', 'Zischtag', 'Mittwuch', 'Frontag', 'Fritag', 'Samschtag'],
|
||||
'weekdays_short' => ['Sun', 'Män', 'Zis', 'Mit', 'Fro', 'Fri', 'Sam'],
|
||||
'weekdays_min' => ['Sun', 'Män', 'Zis', 'Mit', 'Fro', 'Fri', 'Sam'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 4,
|
||||
|
||||
'month' => ':count Maano', // less reliable
|
||||
'm' => ':count Maano', // less reliable
|
||||
'a_month' => ':count Maano', // less reliable
|
||||
]);
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/wal_ET.php';
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Ge'ez Frontier Foundation locales@geez.org
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YYYY',
|
||||
],
|
||||
'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'],
|
||||
'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'],
|
||||
'weekdays' => ['ወጋ', 'ሳይኖ', 'ማቆሳኛ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ'],
|
||||
'weekdays_short' => ['ወጋ ', 'ሳይኖ', 'ማቆሳ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ '],
|
||||
'weekdays_min' => ['ወጋ ', 'ሳይኖ', 'ማቆሳ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ '],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'meridiem' => ['ማለዶ', 'ቃማ'],
|
||||
]);
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/wo_SN.php';
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - The Debian Project Christian Perrier bubulle@debian.org
|
||||
*/
|
||||
return [
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'DD.MM.YYYY',
|
||||
'LL' => 'MMMM DD, YYYY',
|
||||
'LLL' => 'DD MMM HH:mm',
|
||||
'LLLL' => 'MMMM DD, YYYY HH:mm',
|
||||
],
|
||||
'months' => ['sanwiy\'e', 'feebriy\'e', 'mars', 'awril', 'me', 'suwen', 'sulet', 'uut', 'septaambar', 'oktoobar', 'nowaambar', 'desaambar'],
|
||||
'months_short' => ['san', 'fee', 'mar', 'awr', 'me ', 'suw', 'sul', 'uut', 'sep', 'okt', 'now', 'des'],
|
||||
'weekdays' => ['dib\'eer', 'altine', 'talaata', 'allarba', 'alxames', 'ajjuma', 'gaawu'],
|
||||
'weekdays_short' => ['dib', 'alt', 'tal', 'all', 'alx', 'ajj', 'gaa'],
|
||||
'weekdays_min' => ['dib', 'alt', 'tal', 'all', 'alx', 'ajj', 'gaa'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'year' => ':count at',
|
||||
'month' => ':count wèr',
|
||||
'week' => ':count ayubés',
|
||||
'day' => ':count bés',
|
||||
'hour' => ':count waxtu',
|
||||
'minute' => ':count simili',
|
||||
'second' => ':count saa',
|
||||
];
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/xh_ZA.php';
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YYYY',
|
||||
],
|
||||
'months' => ['eyoMqungu', 'eyoMdumba', 'eyoKwindla', 'uTshazimpuzi', 'uCanzibe', 'eyeSilimela', 'eyeKhala', 'eyeThupa', 'eyoMsintsi', 'eyeDwarha', 'eyeNkanga', 'eyoMnga'],
|
||||
'months_short' => ['Mqu', 'Mdu', 'Kwi', 'Tsh', 'Can', 'Sil', 'Kha', 'Thu', 'Msi', 'Dwa', 'Nka', 'Mng'],
|
||||
'weekdays' => ['iCawa', 'uMvulo', 'lwesiBini', 'lwesiThathu', 'ulweSine', 'lwesiHlanu', 'uMgqibelo'],
|
||||
'weekdays_short' => ['Caw', 'Mvu', 'Bin', 'Tha', 'Sin', 'Hla', 'Mgq'],
|
||||
'weekdays_min' => ['Caw', 'Mvu', 'Bin', 'Tha', 'Sin', 'Hla', 'Mgq'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
|
||||
'year' => ':count ihlobo', // less reliable
|
||||
'y' => ':count ihlobo', // less reliable
|
||||
'a_year' => ':count ihlobo', // less reliable
|
||||
|
||||
'hour' => ':count iwotshi', // less reliable
|
||||
'h' => ':count iwotshi', // less reliable
|
||||
'a_hour' => ':count iwotshi', // less reliable
|
||||
|
||||
'minute' => ':count ingqalelo', // less reliable
|
||||
'min' => ':count ingqalelo', // less reliable
|
||||
'a_minute' => ':count ingqalelo', // less reliable
|
||||
|
||||
'second' => ':count nceda', // less reliable
|
||||
's' => ':count nceda', // less reliable
|
||||
'a_second' => ':count nceda', // less reliable
|
||||
|
||||
'month' => ':count inyanga',
|
||||
'm' => ':count inyanga',
|
||||
'a_month' => ':count inyanga',
|
||||
|
||||
'week' => ':count veki',
|
||||
'w' => ':count veki',
|
||||
'a_week' => ':count veki',
|
||||
|
||||
'day' => ':count imini',
|
||||
'd' => ':count imini',
|
||||
'a_day' => ':count imini',
|
||||
]);
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'meridiem' => ['Munkyo', 'Eigulo'],
|
||||
'weekdays' => ['Sabiiti', 'Balaza', 'Owokubili', 'Owokusatu', 'Olokuna', 'Olokutaanu', 'Olomukaaga'],
|
||||
'weekdays_short' => ['Sabi', 'Bala', 'Kubi', 'Kusa', 'Kuna', 'Kuta', 'Muka'],
|
||||
'weekdays_min' => ['Sabi', 'Bala', 'Kubi', 'Kusa', 'Kuna', 'Kuta', 'Muka'],
|
||||
'months' => ['Janwaliyo', 'Febwaliyo', 'Marisi', 'Apuli', 'Maayi', 'Juuni', 'Julaayi', 'Agusito', 'Sebuttemba', 'Okitobba', 'Novemba', 'Desemba'],
|
||||
'months_short' => ['Jan', 'Feb', 'Mar', 'Apu', 'Maa', 'Juu', 'Jul', 'Agu', 'Seb', 'Oki', 'Nov', 'Des'],
|
||||
'first_day_of_week' => 1,
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'DD/MM/YYYY',
|
||||
'LL' => 'D MMM YYYY',
|
||||
'LLL' => 'D MMMM YYYY HH:mm',
|
||||
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
|
||||
],
|
||||
]);
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'meridiem' => ['kiɛmɛ́ɛm', 'kisɛ́ndɛ'],
|
||||
'weekdays' => ['sɔ́ndiɛ', 'móndie', 'muányáŋmóndie', 'metúkpíápɛ', 'kúpélimetúkpiapɛ', 'feléte', 'séselé'],
|
||||
'weekdays_short' => ['sd', 'md', 'mw', 'et', 'kl', 'fl', 'ss'],
|
||||
'weekdays_min' => ['sd', 'md', 'mw', 'et', 'kl', 'fl', 'ss'],
|
||||
'months' => ['pikítíkítie, oólí ú kutúan', 'siɛyɛ́, oóli ú kándíɛ', 'ɔnsúmbɔl, oóli ú kátátúɛ', 'mesiŋ, oóli ú kénie', 'ensil, oóli ú kátánuɛ', 'ɔsɔn', 'efute', 'pisuyú', 'imɛŋ i puɔs', 'imɛŋ i putúk,oóli ú kátíɛ', 'makandikɛ', 'pilɔndɔ́'],
|
||||
'months_short' => ['o.1', 'o.2', 'o.3', 'o.4', 'o.5', 'o.6', 'o.7', 'o.8', 'o.9', 'o.10', 'o.11', 'o.12'],
|
||||
'first_day_of_week' => 1,
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'D/M/YYYY',
|
||||
'LL' => 'D MMM YYYY',
|
||||
'LLL' => 'D MMMM YYYY HH:mm',
|
||||
'LLLL' => 'dddd D MMMM YYYY HH:mm',
|
||||
],
|
||||
]);
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/yi_US.php';
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - http://www.uyip.org/ Pablo Saratxaga pablo@mandrakesoft.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YY',
|
||||
],
|
||||
'months' => ['יאַנואַר', 'פֿעברואַר', 'מערץ', 'אַפּריל', 'מיי', 'יוני', 'יולי', 'אויגוסט', 'סעפּטעמבער', 'אקטאבער', 'נאוועמבער', 'דעצעמבער'],
|
||||
'months_short' => ['יאַנ', 'פֿעב', 'מאַר', 'אַפּר', 'מײַ ', 'יונ', 'יול', 'אױג', 'סעפּ', 'אָקט', 'נאָװ', 'דעצ'],
|
||||
'weekdays' => ['זונטיק', 'מאָנטיק', 'דינסטיק', 'מיטװאָך', 'דאָנערשטיק', 'פֿרײַטיק', 'שבת'],
|
||||
'weekdays_short' => ['זונ\'', 'מאָנ\'', 'דינ\'', 'מיט\'', 'דאָנ\'', 'פֿרײַ\'', 'שבת'],
|
||||
'weekdays_min' => ['זונ\'', 'מאָנ\'', 'דינ\'', 'מיט\'', 'דאָנ\'', 'פֿרײַ\'', 'שבת'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
|
||||
'year' => ':count יאר',
|
||||
'y' => ':count יאר',
|
||||
'a_year' => ':count יאר',
|
||||
|
||||
'month' => ':count חודש',
|
||||
'm' => ':count חודש',
|
||||
'a_month' => ':count חודש',
|
||||
|
||||
'week' => ':count וואָך',
|
||||
'w' => ':count וואָך',
|
||||
'a_week' => ':count וואָך',
|
||||
|
||||
'day' => ':count טאָג',
|
||||
'd' => ':count טאָג',
|
||||
'a_day' => ':count טאָג',
|
||||
|
||||
'hour' => ':count שעה',
|
||||
'h' => ':count שעה',
|
||||
'a_hour' => ':count שעה',
|
||||
|
||||
'minute' => ':count מינוט',
|
||||
'min' => ':count מינוט',
|
||||
'a_minute' => ':count מינוט',
|
||||
|
||||
'second' => ':count סעקונדע',
|
||||
's' => ':count סעקונדע',
|
||||
'a_second' => ':count סעקונדע',
|
||||
]);
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - François B
|
||||
* - Atolagbe Abisoye
|
||||
*/
|
||||
return [
|
||||
'year' => 'ọdún :count',
|
||||
'a_year' => '{1}ọdún kan|ọdún :count',
|
||||
'month' => 'osù :count',
|
||||
'a_month' => '{1}osù kan|osù :count',
|
||||
'week' => 'ọsẹ :count',
|
||||
'a_week' => '{1}ọsẹ kan|ọsẹ :count',
|
||||
'day' => 'ọjọ́ :count',
|
||||
'a_day' => '{1}ọjọ́ kan|ọjọ́ :count',
|
||||
'hour' => 'wákati :count',
|
||||
'a_hour' => '{1}wákati kan|wákati :count',
|
||||
'minute' => 'ìsẹjú :count',
|
||||
'a_minute' => '{1}ìsẹjú kan|ìsẹjú :count',
|
||||
'second' => 'iaayá :count',
|
||||
'a_second' => '{1}ìsẹjú aayá die|aayá :count',
|
||||
'ago' => ':time kọjá',
|
||||
'from_now' => 'ní :time',
|
||||
'diff_yesterday' => 'Àna',
|
||||
'diff_yesterday_regexp' => 'Àna(?:\\s+ni)?',
|
||||
'diff_today' => 'Ònì',
|
||||
'diff_today_regexp' => 'Ònì(?:\\s+ni)?',
|
||||
'diff_tomorrow' => 'Ọ̀la',
|
||||
'diff_tomorrow_regexp' => 'Ọ̀la(?:\\s+ni)?',
|
||||
'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,
|
||||
'meridiem' => ['Àárọ̀', 'Ọ̀sán'],
|
||||
];
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/yo.php', [
|
||||
'meridiem' => ['Àárɔ̀', 'Ɔ̀sán'],
|
||||
'weekdays' => ['Ɔjɔ́ Àìkú', 'Ɔjɔ́ Ajé', 'Ɔjɔ́ Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɔjɔ́ Ɛtì', 'Ɔjɔ́ Àbámɛ́ta'],
|
||||
'weekdays_short' => ['Àìkú', 'Ajé', 'Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɛtì', 'Àbámɛ́ta'],
|
||||
'weekdays_min' => ['Àìkú', 'Ajé', 'Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɛtì', 'Àbámɛ́ta'],
|
||||
'months' => ['Oshù Shɛ́rɛ́', 'Oshù Èrèlè', 'Oshù Ɛrɛ̀nà', 'Oshù Ìgbé', 'Oshù Ɛ̀bibi', 'Oshù Òkúdu', 'Oshù Agɛmɔ', 'Oshù Ògún', 'Oshù Owewe', 'Oshù Ɔ̀wàrà', 'Oshù Bélú', 'Oshù Ɔ̀pɛ̀'],
|
||||
'months_short' => ['Shɛ́rɛ́', 'Èrèlè', 'Ɛrɛ̀nà', 'Ìgbé', 'Ɛ̀bibi', 'Òkúdu', 'Agɛmɔ', 'Ògún', 'Owewe', 'Ɔ̀wàrà', 'Bélú', 'Ɔ̀pɛ̀'],
|
||||
'first_day_of_week' => 1,
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'DD/MM/YYYY',
|
||||
'LL' => 'D MMM YYYY',
|
||||
'LLL' => 'D MMMM YYYY HH:mm',
|
||||
'LLLL' => 'dddd, D MMMM YYYY HH:mm',
|
||||
],
|
||||
]);
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/yo.php';
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/yue_HK.php';
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - bug-glibc-locales@gnu.org
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/zh_HK.php', [
|
||||
'formats' => [
|
||||
'L' => 'YYYY年MM月DD日 dddd',
|
||||
],
|
||||
'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' => ['日', '一', '二', '三', '四', '五', '六'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'meridiem' => ['上午', '下午'],
|
||||
]);
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hans.php';
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hant.php';
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/yuw_PG.php';
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Information from native speakers Hannah Sarvasy nungon.localization@gmail.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YY',
|
||||
],
|
||||
'months' => ['jenuari', 'febuari', 'mas', 'epril', 'mei', 'jun', 'julai', 'ögus', 'septemba', 'öktoba', 'nöwemba', 'diksemba'],
|
||||
'months_short' => ['jen', 'feb', 'mas', 'epr', 'mei', 'jun', 'jul', 'ögu', 'sep', 'ökt', 'nöw', 'dis'],
|
||||
'weekdays' => ['sönda', 'mönda', 'sinda', 'mitiwö', 'sogipbono', 'nenggo', 'söndanggie'],
|
||||
'weekdays_short' => ['sön', 'mön', 'sin', 'mit', 'soi', 'nen', 'sab'],
|
||||
'weekdays_min' => ['sön', 'mön', 'sin', 'mit', 'soi', 'nen', 'sab'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
]);
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - BAKTETE Miloud
|
||||
*/
|
||||
return [
|
||||
'year' => ':count ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ',
|
||||
'a_year' => 'ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ',
|
||||
'y' => ':count ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ',
|
||||
'month' => ':count ⵡⴰⵢⵢⵓⵔ|:count ⴰⵢⵢⵓⵔⵏ',
|
||||
'a_month' => 'ⵉⴷⵊ ⵡⴰⵢⵢⵓⵔ|:count ⴰⵢⵢⵓⵔⵏ',
|
||||
'm' => ':count ⴰⵢⵢⵓⵔⵏ',
|
||||
'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ|:count ⵉⵎⴰⵍⴰⵙⵙⵏ',
|
||||
'a_week' => 'ⵉⵛⵜ ⵉⵎⴰⵍⴰⵙⵙ|:count ⵉⵎⴰⵍⴰⵙⵙⵏ',
|
||||
'w' => ':count ⵉⵎⴰⵍⴰⵙⵙ.',
|
||||
'day' => ':count ⵡⴰⵙⵙ|:count ⵓⵙⵙⴰⵏ',
|
||||
'a_day' => 'ⵉⴷⵊ ⵡⴰⵙⵙ|:count ⵓⵙⵙⴰⵏ',
|
||||
'd' => ':count ⵓ',
|
||||
'hour' => ':count ⵜⵙⵔⴰⴳⵜ|:count ⵜⵉⵙⵔⴰⴳⵉⵏ',
|
||||
'a_hour' => 'ⵉⵛⵜ ⵜⵙⵔⴰⴳⵜ|:count ⵜⵉⵙⵔⴰⴳⵉⵏ',
|
||||
'h' => ':count ⵜ',
|
||||
'minute' => ':count ⵜⵓⵙⴷⵉⴷⵜ|:count ⵜⵓⵙⴷⵉⴷⵉⵏ',
|
||||
'a_minute' => 'ⵉⵛⵜ ⵜⵓⵙⴷⵉⴷⵜ|:count ⵜⵓⵙⴷⵉⴷⵉⵏ',
|
||||
'min' => ':count ⵜⵓⵙ',
|
||||
'second' => ':count ⵜⵙⵉⵏⵜ|:count ⵜⵉⵙⵉⵏⴰ',
|
||||
'a_second' => 'ⴽⵔⴰ ⵜⵉⵙⵉⵏⴰ|:count ⵜⵉⵙⵉⵏⴰ',
|
||||
's' => ':count ⵜ',
|
||||
'ago' => 'ⵣⴳ :time',
|
||||
'from_now' => 'ⴷⴳ :time',
|
||||
'after' => ':time ⴰⵡⴰⵔ',
|
||||
'before' => ':time ⴷⴰⵜ',
|
||||
'diff_now' => 'ⴰⴷⵡⴰⵍⵉ',
|
||||
'diff_today' => 'ⴰⵙⵙ',
|
||||
'diff_today_regexp' => 'ⴰⵙⵙ(?:\\s+ⴰ/ⴰⴷ)?(?:\\s+ⴳ)?',
|
||||
'diff_yesterday' => 'ⴰⵙⵙⵏⵏⴰⵟ',
|
||||
'diff_yesterday_regexp' => 'ⴰⵙⵙⵏⵏⴰⵟ(?:\\s+ⴳ)?',
|
||||
'diff_tomorrow' => 'ⴰⵙⴽⴽⴰ',
|
||||
'diff_tomorrow_regexp' => 'ⴰⵙⴽⴽⴰ(?:\\s+ⴳ)?',
|
||||
'diff_before_yesterday' => 'ⴼⵔ ⵉⴹⵏⵏⴰⵟ',
|
||||
'diff_after_tomorrow' => 'ⵏⴰⴼ ⵓⵙⴽⴽⴰ',
|
||||
'period_recurrences' => ':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' => '[ⴰⵙⵙ ⴰ/ⴰⴷ ⴳ] LT',
|
||||
'nextDay' => '[ⴰⵙⴽⴽⴰ ⴳ] LT',
|
||||
'nextWeek' => 'dddd [ⴳ] LT',
|
||||
'lastDay' => '[ⴰⵙⵙⵏⵏⴰⵟ ⴳ] LT',
|
||||
'lastWeek' => 'dddd [ⴰⵎⴳⴳⴰⵔⵓ ⴳ] LT',
|
||||
'sameElse' => 'L',
|
||||
],
|
||||
'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'],
|
||||
'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⴰⵏⴱⵉⵔ'],
|
||||
'months_short' => ['ⵉⵏⵏ', 'ⴱⵕⴰ', 'ⵎⴰⵕ', 'ⵉⴱⵔ', 'ⵎⴰⵢ', 'ⵢⵓⵏ', 'ⵢⵓⵍ', 'ⵖⵓⵛ', 'ⵛⵓⵜ', 'ⴽⵟⵓ', 'ⵏⵓⵡ', 'ⴷⵓⵊ'],
|
||||
'weekdays' => ['ⵓⵙⴰⵎⴰⵙ', 'ⵡⴰⵢⵏⴰⵙ', 'ⵓⵙⵉⵏⴰⵙ', 'ⵡⴰⴽⵕⴰⵙ', 'ⵓⴽⵡⴰⵙ', 'ⵓⵙⵉⵎⵡⴰⵙ', 'ⵓⵙⵉⴹⵢⴰⵙ'],
|
||||
'weekdays_short' => ['ⵓⵙⴰ', 'ⵡⴰⵢ', 'ⵓⵙⵉ', 'ⵡⴰⴽ', 'ⵓⴽⵡ', 'ⵓⵙⵉⵎ', 'ⵓⵙⵉⴹ'],
|
||||
'weekdays_min' => ['ⵓⵙⴰ', 'ⵡⴰⵢ', 'ⵓⵙⵉ', 'ⵡⴰⴽ', 'ⵓⴽⵡ', 'ⵓⵙⵉⵎ', 'ⵓⵙⵉⴹ'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'list' => [', ', ' ⴷ '],
|
||||
];
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - xuri
|
||||
* - sycuato
|
||||
* - bokideckonja
|
||||
* - Luo Ning
|
||||
* - William Yang (williamyang233)
|
||||
*/
|
||||
return array_merge(require __DIR__.'/zh_Hans.php', [
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'YYYY/MM/DD',
|
||||
'LL' => 'YYYY年M月D日',
|
||||
'LLL' => 'YYYY年M月D日 A h点mm分',
|
||||
'LLLL' => 'YYYY年M月D日dddd A h点mm分',
|
||||
],
|
||||
]);
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - monkeycon
|
||||
* - François B
|
||||
* - Jason Katz-Brown
|
||||
* - Serhan Apaydın
|
||||
* - Matt Johnson
|
||||
* - JD Isaacks
|
||||
* - Zeno Zeng
|
||||
* - Chris Hemp
|
||||
* - shankesgk2
|
||||
*/
|
||||
return array_merge(require __DIR__.'/zh.php', [
|
||||
'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分',
|
||||
],
|
||||
]);
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hant_HK.php';
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - monkeycon
|
||||
* - François B
|
||||
* - Jason Katz-Brown
|
||||
* - Konstantin Konev
|
||||
* - Chris Lam
|
||||
* - Serhan Apaydın
|
||||
* - Gary Lo
|
||||
* - JD Isaacks
|
||||
* - Chris Hemp
|
||||
* - shankesgk2
|
||||
* - Daniel Cheung (danvim)
|
||||
*/
|
||||
return [
|
||||
'year' => ':count:optional-space年',
|
||||
'y' => ':count:optional-space年',
|
||||
'month' => ':count:optional-space个月',
|
||||
'm' => ':count:optional-space个月',
|
||||
'week' => ':count:optional-space周',
|
||||
'w' => ':count:optional-space周',
|
||||
'day' => ':count:optional-space天',
|
||||
'd' => ':count:optional-space天',
|
||||
'hour' => ':count:optional-space小时',
|
||||
'h' => ':count:optional-space小时',
|
||||
'minute' => ':count:optional-space分钟',
|
||||
'min' => ':count:optional-space分钟',
|
||||
'second' => ':count:optional-space秒',
|
||||
'a_second' => '{1}几秒|]1,Inf[:count:optional-space秒',
|
||||
's' => ':count:optional-space秒',
|
||||
'ago' => ':time前',
|
||||
'from_now' => ':time后',
|
||||
'after' => ':time后',
|
||||
'before' => ':time前',
|
||||
'diff_now' => '现在',
|
||||
'diff_today' => '今天',
|
||||
'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' => static function ($number, $period) {
|
||||
return match ($period) {
|
||||
'd', 'D', 'DDD' => $number.'日',
|
||||
'M' => $number.'月',
|
||||
'w', 'W' => $number.'周',
|
||||
default => $number,
|
||||
};
|
||||
},
|
||||
'meridiem' => static function ($hour, $minute) {
|
||||
$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,
|
||||
'list' => '',
|
||||
];
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hans.php';
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hans.php';
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hans.php';
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Adam
|
||||
* - monkeycon
|
||||
* - François B
|
||||
* - Jason Katz-Brown
|
||||
* - Chris Lam
|
||||
* - Serhan Apaydın
|
||||
* - Gary Lo
|
||||
* - JD Isaacks
|
||||
* - Chris Hemp
|
||||
* - Eddie
|
||||
* - KID
|
||||
* - shankesgk2
|
||||
* - Daniel Cheung (danvim)
|
||||
*/
|
||||
return [
|
||||
'year' => ':count:optional-space年',
|
||||
'y' => ':count:optional-space年',
|
||||
'month' => ':count:optional-space個月',
|
||||
'm' => ':count:optional-space月',
|
||||
'week' => ':count:optional-space週',
|
||||
'w' => ':count:optional-space週',
|
||||
'day' => ':count:optional-space天',
|
||||
'd' => ':count:optional-space天',
|
||||
'hour' => ':count:optional-space小時',
|
||||
'h' => ':count:optional-space小時',
|
||||
'minute' => ':count:optional-space分鐘',
|
||||
'min' => ':count:optional-space分鐘',
|
||||
'second' => ':count:optional-space秒',
|
||||
'a_second' => '{1}幾秒|]1,Inf[:count:optional-space秒',
|
||||
's' => ':count:optional-space秒',
|
||||
'ago' => ':time前',
|
||||
'from_now' => ':time後',
|
||||
'after' => ':time後',
|
||||
'before' => ':time前',
|
||||
'diff_now' => '現在',
|
||||
'diff_today' => '今天',
|
||||
'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' => static function ($number, $period) {
|
||||
return match ($period) {
|
||||
'd', 'D', 'DDD' => $number.'日',
|
||||
'M' => $number.'月',
|
||||
'w', 'W' => $number.'周',
|
||||
default => $number,
|
||||
};
|
||||
},
|
||||
'meridiem' => static function ($hour, $minute) {
|
||||
$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,
|
||||
'list' => '',
|
||||
];
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hant.php';
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hant.php';
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hant.php';
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - tarunvelli
|
||||
* - Eddie
|
||||
* - KID
|
||||
* - shankesgk2
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/zh_Hant.php', [
|
||||
'after' => ':time后',
|
||||
]);
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/zh.php', [
|
||||
'formats' => [
|
||||
'L' => 'YYYY年MM月DD日',
|
||||
],
|
||||
'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
||||
'months_short' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
||||
'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
||||
'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'],
|
||||
'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'],
|
||||
'day_of_first_week_of_year' => 1,
|
||||
]);
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return require __DIR__.'/zh_Hant_TW.php';
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/zh.php', [
|
||||
'formats' => [
|
||||
'L' => 'YYYY-MM-DD',
|
||||
],
|
||||
]);
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unknown default region, use the first alphabetically.
|
||||
*/
|
||||
return require __DIR__.'/zu_ZA.php';
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YYYY',
|
||||
],
|
||||
'months' => ['Januwari', 'Februwari', 'Mashi', 'Ephreli', 'Meyi', 'Juni', 'Julayi', 'Agasti', 'Septhemba', 'Okthoba', 'Novemba', 'Disemba'],
|
||||
'months_short' => ['Jan', 'Feb', 'Mas', 'Eph', 'Mey', 'Jun', 'Jul', 'Aga', 'Sep', 'Okt', 'Nov', 'Dis'],
|
||||
'weekdays' => ['iSonto', 'uMsombuluko', 'uLwesibili', 'uLwesithathu', 'uLwesine', 'uLwesihlanu', 'uMgqibelo'],
|
||||
'weekdays_short' => ['Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq'],
|
||||
'weekdays_min' => ['Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
|
||||
'year' => 'kweminyaka engu-:count',
|
||||
'y' => 'kweminyaka engu-:count',
|
||||
'a_year' => 'kweminyaka engu-:count',
|
||||
|
||||
'month' => 'izinyanga ezingu-:count',
|
||||
'm' => 'izinyanga ezingu-:count',
|
||||
'a_month' => 'izinyanga ezingu-:count',
|
||||
|
||||
'week' => 'lwamasonto angu-:count',
|
||||
'w' => 'lwamasonto angu-:count',
|
||||
'a_week' => 'lwamasonto angu-:count',
|
||||
|
||||
'day' => 'ezingaba ngu-:count',
|
||||
'd' => 'ezingaba ngu-:count',
|
||||
'a_day' => 'ezingaba ngu-:count',
|
||||
|
||||
'hour' => 'amahora angu-:count',
|
||||
'h' => 'amahora angu-:count',
|
||||
'a_hour' => 'amahora angu-:count',
|
||||
|
||||
'minute' => 'ngemizuzu engu-:count',
|
||||
'min' => 'ngemizuzu engu-:count',
|
||||
'a_minute' => 'ngemizuzu engu-:count',
|
||||
|
||||
'second' => 'imizuzwana engu-:count',
|
||||
's' => 'imizuzwana engu-:count',
|
||||
'a_second' => 'imizuzwana engu-:count',
|
||||
]);
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
class Language implements JsonSerializable
|
||||
{
|
||||
protected static ?array $languagesNames = null;
|
||||
|
||||
protected static ?array $regionsNames = null;
|
||||
|
||||
protected string $id;
|
||||
|
||||
protected string $code;
|
||||
|
||||
protected ?string $variant = null;
|
||||
|
||||
protected ?string $region = null;
|
||||
|
||||
protected ?array $names = null;
|
||||
|
||||
protected ?string $isoName = null;
|
||||
|
||||
protected ?string $nativeName = null;
|
||||
|
||||
public function __construct(string $id)
|
||||
{
|
||||
$this->id = str_replace('-', '_', $id);
|
||||
$parts = explode('_', $this->id);
|
||||
$this->code = $parts[0];
|
||||
|
||||
if (isset($parts[1])) {
|
||||
if (!preg_match('/^[A-Z]+$/', $parts[1])) {
|
||||
$this->variant = $parts[1];
|
||||
$parts[1] = $parts[2] ?? null;
|
||||
}
|
||||
if ($parts[1]) {
|
||||
$this->region = $parts[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of the known languages.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function all(): array
|
||||
{
|
||||
static::$languagesNames ??= require __DIR__.'/List/languages.php';
|
||||
|
||||
return static::$languagesNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of the known regions.
|
||||
*
|
||||
* ⚠ ISO 3166-2 short name provided with no warranty, should not
|
||||
* be used for any purpose to show official state names.
|
||||
*/
|
||||
public static function regions(): array
|
||||
{
|
||||
static::$regionsNames ??= require __DIR__.'/List/regions.php';
|
||||
|
||||
return static::$regionsNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get both isoName and nativeName as an array.
|
||||
*/
|
||||
public function getNames(): array
|
||||
{
|
||||
$this->names ??= static::all()[$this->code] ?? [
|
||||
'isoName' => $this->code,
|
||||
'nativeName' => $this->code,
|
||||
];
|
||||
|
||||
return $this->names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the original locale ID.
|
||||
*/
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the code of the locale "en"/"fr".
|
||||
*/
|
||||
public function getCode(): string
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the variant code such as cyrl/latn.
|
||||
*/
|
||||
public function getVariant(): ?string
|
||||
{
|
||||
return $this->variant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the variant such as Cyrillic/Latin.
|
||||
*/
|
||||
public function getVariantName(): ?string
|
||||
{
|
||||
if ($this->variant === 'Latn') {
|
||||
return 'Latin';
|
||||
}
|
||||
|
||||
if ($this->variant === 'Cyrl') {
|
||||
return 'Cyrillic';
|
||||
}
|
||||
|
||||
return $this->variant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the region part of the locale.
|
||||
*/
|
||||
public function getRegion(): ?string
|
||||
{
|
||||
return $this->region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the region name for the current language.
|
||||
*
|
||||
* ⚠ ISO 3166-2 short name provided with no warranty, should not
|
||||
* be used for any purpose to show official state names.
|
||||
*/
|
||||
public function getRegionName(): ?string
|
||||
{
|
||||
return $this->region ? (static::regions()[$this->region] ?? $this->region) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the long ISO language name.
|
||||
*/
|
||||
public function getFullIsoName(): string
|
||||
{
|
||||
$this->isoName ??= $this->getNames()['isoName'];
|
||||
|
||||
return $this->isoName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the ISO language name.
|
||||
*/
|
||||
public function setIsoName(string $isoName): static
|
||||
{
|
||||
$this->isoName = $isoName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the full name of the language in this language.
|
||||
*/
|
||||
public function getFullNativeName(): string
|
||||
{
|
||||
$this->nativeName ??= $this->getNames()['nativeName'];
|
||||
|
||||
return $this->nativeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name of the language in this language.
|
||||
*/
|
||||
public function setNativeName(string $nativeName): static
|
||||
{
|
||||
$this->nativeName = $nativeName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the short ISO language name.
|
||||
*/
|
||||
public function getIsoName(): string
|
||||
{
|
||||
$name = $this->getFullIsoName();
|
||||
|
||||
return trim(strstr($name, ',', true) ?: $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the short name of the language in this language.
|
||||
*/
|
||||
public function getNativeName(): string
|
||||
{
|
||||
$name = $this->getFullNativeName();
|
||||
|
||||
return trim(strstr($name, ',', true) ?: $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable.
|
||||
*/
|
||||
public function getIsoDescription(): string
|
||||
{
|
||||
$region = $this->getRegionName();
|
||||
$variant = $this->getVariantName();
|
||||
|
||||
return $this->getIsoName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a string with short native name, region in parentheses if applicable, variant in parentheses if applicable.
|
||||
*/
|
||||
public function getNativeDescription(): string
|
||||
{
|
||||
$region = $this->getRegionName();
|
||||
$variant = $this->getVariantName();
|
||||
|
||||
return $this->getNativeName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a string with long ISO name, region in parentheses if applicable, variant in parentheses if applicable.
|
||||
*/
|
||||
public function getFullIsoDescription(): string
|
||||
{
|
||||
$region = $this->getRegionName();
|
||||
$variant = $this->getVariantName();
|
||||
|
||||
return $this->getFullIsoName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a string with long native name, region in parentheses if applicable, variant in parentheses if applicable.
|
||||
*/
|
||||
public function getFullNativeDescription(): string
|
||||
{
|
||||
$region = $this->getRegionName();
|
||||
$variant = $this->getVariantName();
|
||||
|
||||
return $this->getFullNativeName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the original locale ID.
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable.
|
||||
*/
|
||||
public function jsonSerialize(): string
|
||||
{
|
||||
return $this->getIsoDescription();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Laravel;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Carbon\CarbonInterval;
|
||||
use Carbon\CarbonPeriod;
|
||||
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
|
||||
use Illuminate\Events\Dispatcher;
|
||||
use Illuminate\Events\EventDispatcher;
|
||||
use Illuminate\Support\Carbon as IlluminateCarbon;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Throwable;
|
||||
|
||||
class ServiceProvider extends \Illuminate\Support\ServiceProvider
|
||||
{
|
||||
/** @var callable|null */
|
||||
protected $appGetter = null;
|
||||
|
||||
/** @var callable|null */
|
||||
protected $localeGetter = null;
|
||||
|
||||
public function setAppGetter(?callable $appGetter): void
|
||||
{
|
||||
$this->appGetter = $appGetter;
|
||||
}
|
||||
|
||||
public function setLocaleGetter(?callable $localeGetter): void
|
||||
{
|
||||
$this->localeGetter = $localeGetter;
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
$this->updateLocale();
|
||||
|
||||
if (!$this->app->bound('events')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$service = $this;
|
||||
$events = $this->app['events'];
|
||||
|
||||
if ($this->isEventDispatcher($events)) {
|
||||
$events->listen(class_exists('Illuminate\Foundation\Events\LocaleUpdated') ? 'Illuminate\Foundation\Events\LocaleUpdated' : 'locale.changed', function () use ($service) {
|
||||
$service->updateLocale();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function updateLocale()
|
||||
{
|
||||
$locale = $this->getLocale();
|
||||
|
||||
if ($locale === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Carbon::setLocale($locale);
|
||||
CarbonImmutable::setLocale($locale);
|
||||
CarbonPeriod::setLocale($locale);
|
||||
CarbonInterval::setLocale($locale);
|
||||
|
||||
if (class_exists(IlluminateCarbon::class)) {
|
||||
IlluminateCarbon::setLocale($locale);
|
||||
}
|
||||
|
||||
if (class_exists(Date::class)) {
|
||||
try {
|
||||
$root = Date::getFacadeRoot();
|
||||
$root->setLocale($locale);
|
||||
} catch (Throwable) {
|
||||
// Non Carbon class in use in Date facade
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function register()
|
||||
{
|
||||
// Needed for Laravel < 5.3 compatibility
|
||||
}
|
||||
|
||||
protected function getLocale()
|
||||
{
|
||||
if ($this->localeGetter) {
|
||||
return ($this->localeGetter)();
|
||||
}
|
||||
|
||||
$app = $this->getApp();
|
||||
$app = $app && method_exists($app, 'getLocale')
|
||||
? $app
|
||||
: $this->getGlobalApp('translator');
|
||||
|
||||
return $app ? $app->getLocale() : null;
|
||||
}
|
||||
|
||||
protected function getApp()
|
||||
{
|
||||
if ($this->appGetter) {
|
||||
return ($this->appGetter)();
|
||||
}
|
||||
|
||||
return $this->app ?? $this->getGlobalApp();
|
||||
}
|
||||
|
||||
protected function getGlobalApp(...$args)
|
||||
{
|
||||
return \function_exists('app') ? \app(...$args) : null;
|
||||
}
|
||||
|
||||
protected function isEventDispatcher($instance)
|
||||
{
|
||||
return $instance instanceof EventDispatcher
|
||||
|| $instance instanceof Dispatcher
|
||||
|| $instance instanceof DispatcherContract;
|
||||
}
|
||||
}
|
||||
+1241
File diff suppressed because it is too large
Load Diff
+292
@@ -0,0 +1,292 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ISO 3166-2 short names.
|
||||
*
|
||||
* ⚠ Provided with No Warranty
|
||||
*
|
||||
* This list has no official value, and it's using short name, i.e. the first column of
|
||||
* https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
|
||||
*
|
||||
* Without the extra parenthesis unless a particular ambiguity in the list.
|
||||
*
|
||||
* For instance:
|
||||
* - Falkland Islands and Malvinas both to FK, but we keep only the first for brevity and
|
||||
* because there is no ambiguity in the list to justify longer name.
|
||||
* - For Sint Maarten/Saint Martin not to have any confusion between FM and SX codes that
|
||||
* are on the same island and so to be clear it's not referring to the whole island,
|
||||
* south (dutch-speaking) and north (french-speaking) parentheses are kept for disambiguation.
|
||||
* - For Virgin Islands, that can refer to either VG or VI, parentheses are also kept for
|
||||
* disambiguation.
|
||||
*
|
||||
* We won't take into consideration any change request in this list unless there is an update
|
||||
* in ISO 3166-2 itself that we need to align to.
|
||||
*
|
||||
* It's a purely geographical helper, state sovereignty is out of scope, for political
|
||||
* complains you should address them directly to https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
|
||||
*
|
||||
* Anyone needing official state names (such as the second column of the wikipedia page above)
|
||||
* should seek for another tool, this list is not meant to provide long names.
|
||||
*/
|
||||
return [
|
||||
'AD' => 'Andorra',
|
||||
'AE' => 'United Arab Emirates',
|
||||
'AF' => 'Afghanistan',
|
||||
'AG' => 'Antigua and Barbuda',
|
||||
'AI' => 'Anguilla',
|
||||
'AL' => 'Albania',
|
||||
'AM' => 'Armenia',
|
||||
'AO' => 'Angola',
|
||||
'AQ' => 'Antarctica',
|
||||
'AR' => 'Argentina',
|
||||
'AS' => 'American Samoa',
|
||||
'AT' => 'Austria',
|
||||
'AU' => 'Australia',
|
||||
'AW' => 'Aruba',
|
||||
'AX' => 'Åland Islands',
|
||||
'AZ' => 'Azerbaijan',
|
||||
'BA' => 'Bosnia and Herzegovina',
|
||||
'BB' => 'Barbados',
|
||||
'BD' => 'Bangladesh',
|
||||
'BE' => 'Belgium',
|
||||
'BF' => 'Burkina Faso',
|
||||
'BG' => 'Bulgaria',
|
||||
'BH' => 'Bahrain',
|
||||
'BI' => 'Burundi',
|
||||
'BJ' => 'Benin',
|
||||
'BL' => 'Saint Barthélemy',
|
||||
'BM' => 'Bermuda',
|
||||
'BN' => 'Brunei Darussalam',
|
||||
'BO' => 'Bolivia',
|
||||
'BQ' => 'Bonaire, Sint Eustatius and Saba',
|
||||
'BR' => 'Brazil',
|
||||
'BS' => 'Bahamas',
|
||||
'BT' => 'Bhutan',
|
||||
'BV' => 'Bouvet Island',
|
||||
'BW' => 'Botswana',
|
||||
'BY' => 'Belarus',
|
||||
'BZ' => 'Belize',
|
||||
'CA' => 'Canada',
|
||||
'CC' => 'Cocos (Keeling) Islands',
|
||||
'CD' => 'Congo, Democratic Republic of the',
|
||||
'CF' => 'Central African Republic',
|
||||
'CG' => 'Congo',
|
||||
'CH' => 'Switzerland',
|
||||
'CI' => 'Côte d\'Ivoire',
|
||||
'CK' => 'Cook Islands',
|
||||
'CL' => 'Chile',
|
||||
'CM' => 'Cameroon',
|
||||
'CN' => 'China',
|
||||
'CO' => 'Colombia',
|
||||
'CR' => 'Costa Rica',
|
||||
'CU' => 'Cuba',
|
||||
'CV' => 'Cabo Verde',
|
||||
'CW' => 'Curaçao',
|
||||
'CX' => 'Christmas Island',
|
||||
'CY' => 'Cyprus',
|
||||
'CZ' => 'Czechia',
|
||||
'DE' => 'Germany',
|
||||
'DJ' => 'Djibouti',
|
||||
'DK' => 'Denmark',
|
||||
'DM' => 'Dominica',
|
||||
'DO' => 'Dominican Republic',
|
||||
'DZ' => 'Algeria',
|
||||
'EC' => 'Ecuador',
|
||||
'EE' => 'Estonia',
|
||||
'EG' => 'Egypt',
|
||||
'EH' => 'Western Sahara',
|
||||
'ER' => 'Eritrea',
|
||||
'ES' => 'Spain',
|
||||
'ET' => 'Ethiopia',
|
||||
'FI' => 'Finland',
|
||||
'FJ' => 'Fiji',
|
||||
'FK' => 'Falkland Islands',
|
||||
'FM' => 'Micronesia',
|
||||
'FO' => 'Faroe Islands',
|
||||
'FR' => 'France',
|
||||
'GA' => 'Gabon',
|
||||
'GB' => 'United Kingdom of Great Britain and Northern Ireland',
|
||||
'GD' => 'Grenada',
|
||||
'GE' => 'Georgia',
|
||||
'GF' => 'French Guiana',
|
||||
'GG' => 'Guernsey',
|
||||
'GH' => 'Ghana',
|
||||
'GI' => 'Gibraltar',
|
||||
'GL' => 'Greenland',
|
||||
'GM' => 'Gambia',
|
||||
'GN' => 'Guinea',
|
||||
'GP' => 'Guadeloupe',
|
||||
'GQ' => 'Equatorial Guinea',
|
||||
'GR' => 'Greece',
|
||||
'GS' => 'South Georgia and the South Sandwich Islands',
|
||||
'GT' => 'Guatemala',
|
||||
'GU' => 'Guam',
|
||||
'GW' => 'Guinea-Bissau',
|
||||
'GY' => 'Guyana',
|
||||
'HK' => 'Hong Kong',
|
||||
'HM' => 'Heard Island and McDonald Islands',
|
||||
'HN' => 'Honduras',
|
||||
'HR' => 'Croatia',
|
||||
'HT' => 'Haiti',
|
||||
'HU' => 'Hungary',
|
||||
'ID' => 'Indonesia',
|
||||
'IE' => 'Ireland',
|
||||
'IL' => 'Israel',
|
||||
'IM' => 'Isle of Man',
|
||||
'IN' => 'India',
|
||||
'IO' => 'British Indian Ocean Territory',
|
||||
'IQ' => 'Iraq',
|
||||
'IR' => 'Iran',
|
||||
'IS' => 'Iceland',
|
||||
'IT' => 'Italy',
|
||||
'JE' => 'Jersey',
|
||||
'JM' => 'Jamaica',
|
||||
'JO' => 'Jordan',
|
||||
'JP' => 'Japan',
|
||||
'KE' => 'Kenya',
|
||||
'KG' => 'Kyrgyzstan',
|
||||
'KH' => 'Cambodia',
|
||||
'KI' => 'Kiribati',
|
||||
'KM' => 'Comoros',
|
||||
'KN' => 'Saint Kitts and Nevis',
|
||||
'KP' => 'Korea (Democratic People\'s Republic of)',
|
||||
'KR' => 'Korea, Republic of',
|
||||
'KW' => 'Kuwait',
|
||||
'KY' => 'Cayman Islands',
|
||||
'KZ' => 'Kazakhstan',
|
||||
'LA' => 'Lao People\'s Democratic Republic',
|
||||
'LB' => 'Lebanon',
|
||||
'LC' => 'Saint Lucia',
|
||||
'LI' => 'Liechtenstein',
|
||||
'LK' => 'Sri Lanka',
|
||||
'LR' => 'Liberia',
|
||||
'LS' => 'Lesotho',
|
||||
'LT' => 'Lithuania',
|
||||
'LU' => 'Luxembourg',
|
||||
'LV' => 'Latvia',
|
||||
'LY' => 'Libya',
|
||||
'MA' => 'Morocco',
|
||||
'MC' => 'Monaco',
|
||||
'MD' => 'Moldova',
|
||||
'ME' => 'Montenegro',
|
||||
'MF' => 'Saint Martin (French part)',
|
||||
'MG' => 'Madagascar',
|
||||
'MH' => 'Marshall Islands',
|
||||
'MK' => 'North Macedonia',
|
||||
'ML' => 'Mali',
|
||||
'MM' => 'Myanmar',
|
||||
'MN' => 'Mongolia',
|
||||
'MO' => 'Macao',
|
||||
'MP' => 'Northern Mariana Islands',
|
||||
'MQ' => 'Martinique',
|
||||
'MR' => 'Mauritania',
|
||||
'MS' => 'Montserrat',
|
||||
'MT' => 'Malta',
|
||||
'MU' => 'Mauritius',
|
||||
'MV' => 'Maldives',
|
||||
'MW' => 'Malawi',
|
||||
'MX' => 'Mexico',
|
||||
'MY' => 'Malaysia',
|
||||
'MZ' => 'Mozambique',
|
||||
'NA' => 'Namibia',
|
||||
'NC' => 'New Caledonia',
|
||||
'NE' => 'Niger',
|
||||
'NF' => 'Norfolk Island',
|
||||
'NG' => 'Nigeria',
|
||||
'NI' => 'Nicaragua',
|
||||
'NL' => 'Netherlands',
|
||||
'NO' => 'Norway',
|
||||
'NP' => 'Nepal',
|
||||
'NR' => 'Nauru',
|
||||
'NU' => 'Niue',
|
||||
'NZ' => 'New Zealand',
|
||||
'OM' => 'Oman',
|
||||
'PA' => 'Panama',
|
||||
'PE' => 'Peru',
|
||||
'PF' => 'French Polynesia',
|
||||
'PG' => 'Papua New Guinea',
|
||||
'PH' => 'Philippines',
|
||||
'PK' => 'Pakistan',
|
||||
'PL' => 'Poland',
|
||||
'PM' => 'Saint Pierre and Miquelon',
|
||||
'PN' => 'Pitcairn',
|
||||
'PR' => 'Puerto Rico',
|
||||
'PS' => 'Palestine',
|
||||
'PT' => 'Portugal',
|
||||
'PW' => 'Palau',
|
||||
'PY' => 'Paraguay',
|
||||
'QA' => 'Qatar',
|
||||
'RE' => 'Réunion',
|
||||
'RO' => 'Romania',
|
||||
'RS' => 'Serbia',
|
||||
'RU' => 'Russian Federation',
|
||||
'RW' => 'Rwanda',
|
||||
'SA' => 'Saudi Arabia',
|
||||
'SB' => 'Solomon Islands',
|
||||
'SC' => 'Seychelles',
|
||||
'SD' => 'Sudan',
|
||||
'SE' => 'Sweden',
|
||||
'SG' => 'Singapore',
|
||||
'SH' => 'Saint Helena, Ascension and Tristan da Cunha',
|
||||
'SI' => 'Slovenia',
|
||||
'SJ' => 'Svalbard and Jan Mayen',
|
||||
'SK' => 'Slovakia',
|
||||
'SL' => 'Sierra Leone',
|
||||
'SM' => 'San Marino',
|
||||
'SN' => 'Senegal',
|
||||
'SO' => 'Somalia',
|
||||
'SR' => 'Suriname',
|
||||
'SS' => 'South Sudan',
|
||||
'ST' => 'Sao Tome and Principe',
|
||||
'SV' => 'El Salvador',
|
||||
'SX' => 'Sint Maarten (Dutch part)',
|
||||
'SY' => 'Syrian Arab Republic',
|
||||
'SZ' => 'Eswatini',
|
||||
'TC' => 'Turks and Caicos Islands',
|
||||
'TD' => 'Chad',
|
||||
'TF' => 'French Southern Territories',
|
||||
'TG' => 'Togo',
|
||||
'TH' => 'Thailand',
|
||||
'TJ' => 'Tajikistan',
|
||||
'TK' => 'Tokelau',
|
||||
'TL' => 'Timor-Leste',
|
||||
'TM' => 'Turkmenistan',
|
||||
'TN' => 'Tunisia',
|
||||
'TO' => 'Tonga',
|
||||
'TR' => 'Turkey',
|
||||
'TT' => 'Trinidad and Tobago',
|
||||
'TV' => 'Tuvalu',
|
||||
'TW' => 'Taiwan',
|
||||
'TZ' => 'Tanzania',
|
||||
'UA' => 'Ukraine',
|
||||
'UG' => 'Uganda',
|
||||
'UM' => 'United States Minor Outlying Islands',
|
||||
'US' => 'United States of America',
|
||||
'UY' => 'Uruguay',
|
||||
'UZ' => 'Uzbekistan',
|
||||
'VA' => 'Holy See',
|
||||
'VC' => 'Saint Vincent and the Grenadines',
|
||||
'VE' => 'Venezuela',
|
||||
'VG' => 'Virgin Islands (British)',
|
||||
'VI' => 'Virgin Islands (U.S.)',
|
||||
'VN' => 'Viet Nam',
|
||||
'VU' => 'Vanuatu',
|
||||
'WF' => 'Wallis and Futuna',
|
||||
'WS' => 'Samoa',
|
||||
'YE' => 'Yemen',
|
||||
'YT' => 'Mayotte',
|
||||
'ZA' => 'South Africa',
|
||||
'ZM' => 'Zambia',
|
||||
'ZW' => 'Zimbabwe',
|
||||
];
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\MessageFormatter;
|
||||
|
||||
use ReflectionMethod;
|
||||
use Symfony\Component\Translation\Formatter\MessageFormatter;
|
||||
use Symfony\Component\Translation\Formatter\MessageFormatterInterface;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
$transMethod = new ReflectionMethod(MessageFormatterInterface::class, 'format');
|
||||
|
||||
require $transMethod->getParameters()[0]->hasType()
|
||||
? __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php'
|
||||
: __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php';
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
final class MessageFormatterMapper extends LazyMessageFormatter
|
||||
{
|
||||
/**
|
||||
* Wrapped formatter.
|
||||
*
|
||||
* @var MessageFormatterInterface
|
||||
*/
|
||||
protected $formatter;
|
||||
|
||||
public function __construct(?MessageFormatterInterface $formatter = null)
|
||||
{
|
||||
$this->formatter = $formatter ?? new MessageFormatter();
|
||||
}
|
||||
|
||||
protected function transformLocale(?string $locale): ?string
|
||||
{
|
||||
return $locale ? preg_replace('/[_@][A-Za-z][a-z]{2,}/', '', $locale) : $locale;
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon;
|
||||
|
||||
use Carbon\Exceptions\InvalidFormatException;
|
||||
|
||||
enum Month: int
|
||||
{
|
||||
// Using constants is only safe starting from PHP 8.2
|
||||
case January = 1; // CarbonInterface::JANUARY
|
||||
case February = 2; // CarbonInterface::FEBRUARY
|
||||
case March = 3; // CarbonInterface::MARCH
|
||||
case April = 4; // CarbonInterface::APRIL
|
||||
case May = 5; // CarbonInterface::MAY
|
||||
case June = 6; // CarbonInterface::JUNE
|
||||
case July = 7; // CarbonInterface::JULY
|
||||
case August = 8; // CarbonInterface::AUGUST
|
||||
case September = 9; // CarbonInterface::SEPTEMBER
|
||||
case October = 10; // CarbonInterface::OCTOBER
|
||||
case November = 11; // CarbonInterface::NOVEMBER
|
||||
case December = 12; // CarbonInterface::DECEMBER
|
||||
|
||||
public static function int(self|int|null $value): ?int
|
||||
{
|
||||
return $value instanceof self ? $value->value : $value;
|
||||
}
|
||||
|
||||
public static function fromNumber(int $number): self
|
||||
{
|
||||
$month = $number % CarbonInterface::MONTHS_PER_YEAR;
|
||||
|
||||
return self::from($month + ($month < 1 ? CarbonInterface::MONTHS_PER_YEAR : 0));
|
||||
}
|
||||
|
||||
public static function fromName(string $name, ?string $locale = null): self
|
||||
{
|
||||
try {
|
||||
return self::from(CarbonImmutable::parseFromLocale("$name 1", $locale)->month);
|
||||
} catch (InvalidFormatException $exception) {
|
||||
// Possibly current language expect a dot after short name, but it's missing
|
||||
if ($locale !== null && !mb_strlen($name) < 4 && !str_ends_with($name, '.')) {
|
||||
try {
|
||||
return self::from(CarbonImmutable::parseFromLocale("$name. 1", $locale)->month);
|
||||
} catch (InvalidFormatException $e) {
|
||||
// Throw previous error
|
||||
}
|
||||
}
|
||||
|
||||
throw $exception;
|
||||
}
|
||||
}
|
||||
|
||||
public function ofTheYear(CarbonImmutable|int|null $now = null): CarbonImmutable
|
||||
{
|
||||
if (\is_int($now)) {
|
||||
return CarbonImmutable::create($now, $this->value);
|
||||
}
|
||||
|
||||
$modifier = $this->name.' 1st';
|
||||
|
||||
return $now?->modify($modifier) ?? new CarbonImmutable($modifier);
|
||||
}
|
||||
|
||||
public function locale(string $locale, ?CarbonImmutable $now = null): CarbonImmutable
|
||||
{
|
||||
return $this->ofTheYear($now)->locale($locale);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\PHPStan;
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
use Carbon\FactoryImmutable;
|
||||
use Closure;
|
||||
use InvalidArgumentException;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use PHPStan\Reflection\MethodReflection;
|
||||
use PHPStan\Reflection\MethodsClassReflectionExtension;
|
||||
use PHPStan\Reflection\ReflectionProvider;
|
||||
use PHPStan\Type\ClosureTypeFactory;
|
||||
use ReflectionFunction;
|
||||
use ReflectionMethod;
|
||||
use stdClass;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Class MacroExtension.
|
||||
*
|
||||
* @codeCoverageIgnore Pure PHPStan wrapper.
|
||||
*/
|
||||
final class MacroExtension implements MethodsClassReflectionExtension
|
||||
{
|
||||
/**
|
||||
* @var ReflectionProvider
|
||||
*/
|
||||
protected $reflectionProvider;
|
||||
|
||||
/**
|
||||
* @var ClosureTypeFactory
|
||||
*/
|
||||
protected $closureTypeFactory;
|
||||
|
||||
/**
|
||||
* Extension constructor.
|
||||
*
|
||||
* @param ReflectionProvider $reflectionProvider
|
||||
* @param ClosureTypeFactory $closureTypeFactory
|
||||
*/
|
||||
public function __construct(
|
||||
ReflectionProvider $reflectionProvider,
|
||||
ClosureTypeFactory $closureTypeFactory
|
||||
) {
|
||||
$this->reflectionProvider = $reflectionProvider;
|
||||
$this->closureTypeFactory = $closureTypeFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function hasMethod(ClassReflection $classReflection, string $methodName): bool
|
||||
{
|
||||
if (
|
||||
$classReflection->getName() !== CarbonInterface::class &&
|
||||
!$classReflection->isSubclassOf(CarbonInterface::class)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$className = $classReflection->getName();
|
||||
|
||||
return \is_callable([$className, 'hasMacro']) &&
|
||||
$className::hasMacro($methodName);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection
|
||||
{
|
||||
$macros = FactoryImmutable::getDefaultInstance()->getSettings()['macros'] ?? [];
|
||||
$macro = $macros[$methodName] ?? throw new InvalidArgumentException("Macro '$methodName' not found");
|
||||
$static = false;
|
||||
$final = false;
|
||||
$deprecated = false;
|
||||
$docComment = null;
|
||||
|
||||
if (\is_array($macro) && \count($macro) === 2 && \is_string($macro[1])) {
|
||||
\assert($macro[1] !== '');
|
||||
|
||||
$reflection = new ReflectionMethod($macro[0], $macro[1]);
|
||||
$closure = \is_object($macro[0]) ? $reflection->getClosure($macro[0]) : $reflection->getClosure();
|
||||
|
||||
$static = $reflection->isStatic();
|
||||
$final = $reflection->isFinal();
|
||||
$deprecated = $reflection->isDeprecated();
|
||||
$docComment = $reflection->getDocComment() ?: null;
|
||||
} elseif (\is_string($macro)) {
|
||||
$reflection = new ReflectionFunction($macro);
|
||||
$closure = $reflection->getClosure();
|
||||
$deprecated = $reflection->isDeprecated();
|
||||
$docComment = $reflection->getDocComment() ?: null;
|
||||
} elseif ($macro instanceof Closure) {
|
||||
$closure = $macro;
|
||||
|
||||
try {
|
||||
$boundClosure = Closure::bind($closure, new stdClass());
|
||||
$static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null);
|
||||
} catch (Throwable) {
|
||||
$static = true;
|
||||
}
|
||||
|
||||
$reflection = new ReflectionFunction($macro);
|
||||
$deprecated = $reflection->isDeprecated();
|
||||
$docComment = $reflection->getDocComment() ?: null;
|
||||
}
|
||||
|
||||
if (!isset($closure)) {
|
||||
throw new InvalidArgumentException('Could not create reflection from the spec given'); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
$closureType = $this->closureTypeFactory->fromClosureObject($closure);
|
||||
|
||||
return new MacroMethodReflection(
|
||||
$classReflection,
|
||||
$methodName,
|
||||
$closureType,
|
||||
$static,
|
||||
$final,
|
||||
$deprecated,
|
||||
$docComment,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\PHPStan;
|
||||
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use PHPStan\Reflection\MethodReflection;
|
||||
use PHPStan\Reflection\ParametersAcceptor;
|
||||
use PHPStan\TrinaryLogic;
|
||||
use PHPStan\Type\Type;
|
||||
|
||||
use function preg_match;
|
||||
|
||||
class MacroMethodReflection implements MethodReflection
|
||||
{
|
||||
private ClassReflection $declaringClass;
|
||||
private string $methodName;
|
||||
private ParametersAcceptor $macroClosureType;
|
||||
private bool $static;
|
||||
private bool $final;
|
||||
private bool $deprecated;
|
||||
private ?string $docComment;
|
||||
|
||||
public function __construct(
|
||||
ClassReflection $declaringClass,
|
||||
string $methodName,
|
||||
ParametersAcceptor $macroClosureType,
|
||||
bool $static,
|
||||
bool $final,
|
||||
bool $deprecated,
|
||||
?string $docComment
|
||||
) {
|
||||
$this->declaringClass = $declaringClass;
|
||||
$this->methodName = $methodName;
|
||||
$this->macroClosureType = $macroClosureType;
|
||||
$this->static = $static;
|
||||
$this->final = $final;
|
||||
$this->deprecated = $deprecated;
|
||||
$this->docComment = $docComment;
|
||||
}
|
||||
|
||||
public function getDeclaringClass(): ClassReflection
|
||||
{
|
||||
return $this->declaringClass;
|
||||
}
|
||||
|
||||
public function isStatic(): bool
|
||||
{
|
||||
return $this->static;
|
||||
}
|
||||
|
||||
public function isPrivate(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isPublic(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getDocComment(): ?string
|
||||
{
|
||||
return $this->docComment;
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->methodName;
|
||||
}
|
||||
|
||||
public function getPrototype(): \PHPStan\Reflection\ClassMemberReflection
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getVariants(): array
|
||||
{
|
||||
return [$this->macroClosureType];
|
||||
}
|
||||
|
||||
public function isDeprecated(): TrinaryLogic
|
||||
{
|
||||
return TrinaryLogic::createFromBoolean(
|
||||
$this->deprecated ||
|
||||
preg_match('/@deprecated/i', $this->getDocComment() ?: '')
|
||||
);
|
||||
}
|
||||
|
||||
public function getDeprecatedDescription(): ?string
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function isFinal(): TrinaryLogic
|
||||
{
|
||||
return TrinaryLogic::createFromBoolean($this->final);
|
||||
}
|
||||
|
||||
public function isInternal(): TrinaryLogic
|
||||
{
|
||||
return TrinaryLogic::createNo();
|
||||
}
|
||||
|
||||
public function getThrowType(): ?Type
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function hasSideEffects(): TrinaryLogic
|
||||
{
|
||||
return TrinaryLogic::createMaybe();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,469 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Traits;
|
||||
|
||||
use Carbon\Exceptions\UnknownUnitException;
|
||||
use Carbon\Unit;
|
||||
use Carbon\WeekDay;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfDay();
|
||||
* ```
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function startOfDay()
|
||||
{
|
||||
return $this->setTime(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the time to 23:59:59.999999 end of day
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfDay();
|
||||
* ```
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfMonth();
|
||||
* ```
|
||||
*
|
||||
* @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.999999
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfMonth();
|
||||
* ```
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfQuarter();
|
||||
* ```
|
||||
*
|
||||
* @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.999999
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfQuarter();
|
||||
* ```
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfYear();
|
||||
* ```
|
||||
*
|
||||
* @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.999999
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfYear();
|
||||
* ```
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfDecade();
|
||||
* ```
|
||||
*
|
||||
* @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.999999
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfDecade();
|
||||
* ```
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfCentury();
|
||||
* ```
|
||||
*
|
||||
* @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.999999
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfCentury();
|
||||
* ```
|
||||
*
|
||||
* @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 millennium and the time to 00:00:00
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfMillennium();
|
||||
* ```
|
||||
*
|
||||
* @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 millennium and time to 23:59:59.999999
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfMillennium();
|
||||
* ```
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek() . "\n";
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->startOfWeek() . "\n";
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek(Carbon::SUNDAY) . "\n";
|
||||
* ```
|
||||
*
|
||||
* @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function startOfWeek(WeekDay|int|null $weekStartsAt = null): static
|
||||
{
|
||||
return $this
|
||||
->subDays(
|
||||
(static::DAYS_PER_WEEK + $this->dayOfWeek - (WeekDay::int($weekStartsAt) ?? $this->firstWeekDay)) %
|
||||
static::DAYS_PER_WEEK,
|
||||
)
|
||||
->startOfDay();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek() . "\n";
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->endOfWeek() . "\n";
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek(Carbon::SATURDAY) . "\n";
|
||||
* ```
|
||||
*
|
||||
* @param WeekDay|int|null $weekEndsAt optional end allow you to specify the day of week to use to end the week
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function endOfWeek(WeekDay|int|null $weekEndsAt = null): static
|
||||
{
|
||||
return $this
|
||||
->addDays(
|
||||
(static::DAYS_PER_WEEK - $this->dayOfWeek + (WeekDay::int($weekEndsAt) ?? $this->lastWeekDay)) %
|
||||
static::DAYS_PER_WEEK,
|
||||
)
|
||||
->endOfDay();
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify to start of current hour, minutes and seconds become 0
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfHour();
|
||||
* ```
|
||||
*/
|
||||
public function startOfHour(): static
|
||||
{
|
||||
return $this->setTime($this->hour, 0, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify to end of current hour, minutes and seconds become 59
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfHour();
|
||||
* ```
|
||||
*/
|
||||
public function endOfHour(): static
|
||||
{
|
||||
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
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->startOfMinute();
|
||||
* ```
|
||||
*/
|
||||
public function startOfMinute(): static
|
||||
{
|
||||
return $this->setTime($this->hour, $this->minute, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify to end of current minute, seconds become 59
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16')->endOfMinute();
|
||||
* ```
|
||||
*/
|
||||
public function endOfMinute(): static
|
||||
{
|
||||
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
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16.334455')
|
||||
* ->startOfSecond()
|
||||
* ->format('H:i:s.u');
|
||||
* ```
|
||||
*/
|
||||
public function startOfSecond(): static
|
||||
{
|
||||
return $this->setTime($this->hour, $this->minute, $this->second, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify to end of current second, microseconds become 999999
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16.334455')
|
||||
* ->endOfSecond()
|
||||
* ->format('H:i:s.u');
|
||||
* ```
|
||||
*/
|
||||
public function endOfSecond(): static
|
||||
{
|
||||
return $this->setTime($this->hour, $this->minute, $this->second, static::MICROSECONDS_PER_SECOND - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify to start of current millisecond, microseconds such as 12345 become 123000
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16.334455')
|
||||
* ->startOfSecond()
|
||||
* ->format('H:i:s.u');
|
||||
* ```
|
||||
*/
|
||||
public function startOfMillisecond(): static
|
||||
{
|
||||
$millisecond = (int) floor($this->micro / 1000);
|
||||
|
||||
return $this->setTime($this->hour, $this->minute, $this->second, $millisecond * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify to end of current millisecond, microseconds such as 12345 become 123999
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16.334455')
|
||||
* ->endOfSecond()
|
||||
* ->format('H:i:s.u');
|
||||
* ```
|
||||
*/
|
||||
public function endOfMillisecond(): static
|
||||
{
|
||||
$millisecond = (int) floor($this->micro / 1000);
|
||||
|
||||
return $this->setTime($this->hour, $this->minute, $this->second, $millisecond * 1000 + 999);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify to start of current given unit.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16.334455')
|
||||
* ->startOf(Unit::Month)
|
||||
* ->endOf(Unit::Week, Carbon::FRIDAY);
|
||||
* ```
|
||||
*/
|
||||
public function startOf(Unit|string $unit, mixed ...$params): static
|
||||
{
|
||||
$ucfUnit = ucfirst($unit instanceof Unit ? $unit->value : static::singularUnit($unit));
|
||||
$method = "startOf$ucfUnit";
|
||||
if (!method_exists($this, $method)) {
|
||||
throw new UnknownUnitException($unit);
|
||||
}
|
||||
|
||||
return $this->$method(...$params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify to end of current given unit.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::parse('2018-07-25 12:45:16.334455')
|
||||
* ->startOf(Unit::Month)
|
||||
* ->endOf(Unit::Week, Carbon::FRIDAY);
|
||||
* ```
|
||||
*/
|
||||
public function endOf(Unit|string $unit, mixed ...$params): static
|
||||
{
|
||||
$ucfUnit = ucfirst($unit instanceof Unit ? $unit->value : static::singularUnit($unit));
|
||||
$method = "endOf$ucfUnit";
|
||||
if (!method_exists($this, $method)) {
|
||||
throw new UnknownUnitException($unit);
|
||||
}
|
||||
|
||||
return $this->$method(...$params);
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Traits;
|
||||
|
||||
use Carbon\Exceptions\InvalidCastException;
|
||||
use DateTimeInterface;
|
||||
|
||||
/**
|
||||
* Trait Cast.
|
||||
*
|
||||
* Utils to cast into an other class.
|
||||
*/
|
||||
trait Cast
|
||||
{
|
||||
/**
|
||||
* Cast the current instance into the given class.
|
||||
*
|
||||
* @template T
|
||||
*
|
||||
* @param class-string<T> $className The $className::instance() method will be called to cast the current object.
|
||||
*
|
||||
* @return T
|
||||
*/
|
||||
public function cast(string $className): mixed
|
||||
{
|
||||
if (!method_exists($className, 'instance')) {
|
||||
if (is_a($className, DateTimeInterface::class, true)) {
|
||||
return $className::createFromFormat('U.u', $this->rawFormat('U.u'))
|
||||
->setTimezone($this->getTimezone());
|
||||
}
|
||||
|
||||
throw new InvalidCastException("$className has not the instance() method needed to cast the date.");
|
||||
}
|
||||
|
||||
return $className::instance($this);
|
||||
}
|
||||
}
|
||||
+1333
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,556 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* 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 Carbon\CarbonInterval;
|
||||
use Carbon\CarbonPeriod;
|
||||
use Carbon\CarbonPeriodImmutable;
|
||||
use Carbon\Exceptions\UnitException;
|
||||
use Closure;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeInterface;
|
||||
|
||||
/**
|
||||
* Trait Converter.
|
||||
*
|
||||
* Change date into different string formats and types and
|
||||
* handle the string cast.
|
||||
*
|
||||
* Depends on the following methods:
|
||||
*
|
||||
* @method static copy()
|
||||
*/
|
||||
trait Converter
|
||||
{
|
||||
use ToStringFormat;
|
||||
|
||||
/**
|
||||
* Returns the formatted date string on success or FALSE on failure.
|
||||
*
|
||||
* @see https://php.net/manual/en/datetime.format.php
|
||||
*/
|
||||
public function format(string $format): string
|
||||
{
|
||||
$function = $this->localFormatFunction
|
||||
?? $this->getFactory()->getSettings()['formatFunction']
|
||||
?? static::$formatFunction;
|
||||
|
||||
if (!$function) {
|
||||
return $this->rawFormat($format);
|
||||
}
|
||||
|
||||
if (\is_string($function) && method_exists($this, $function)) {
|
||||
$function = [$this, $function];
|
||||
}
|
||||
|
||||
return $function(...\func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://php.net/manual/en/datetime.format.php
|
||||
*/
|
||||
public function rawFormat(string $format): string
|
||||
{
|
||||
return parent::format($format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as a string using the set format
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now(); // Carbon instances can be cast to string
|
||||
* ```
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
$format = $this->localToStringFormat
|
||||
?? $this->getFactory()->getSettings()['toStringFormat']
|
||||
?? null;
|
||||
|
||||
return $format instanceof Closure
|
||||
? $format($this)
|
||||
: $this->rawFormat($format ?: (
|
||||
\defined('static::DEFAULT_TO_STRING_FORMAT')
|
||||
? static::DEFAULT_TO_STRING_FORMAT
|
||||
: CarbonInterface::DEFAULT_TO_STRING_FORMAT
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as date
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toDateString();
|
||||
* ```
|
||||
*/
|
||||
public function toDateString(): string
|
||||
{
|
||||
return $this->rawFormat('Y-m-d');
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as a readable date
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toFormattedDateString();
|
||||
* ```
|
||||
*/
|
||||
public function toFormattedDateString(): string
|
||||
{
|
||||
return $this->rawFormat('M j, Y');
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance with the day, and a readable date
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toFormattedDayDateString();
|
||||
* ```
|
||||
*/
|
||||
public function toFormattedDayDateString(): string
|
||||
{
|
||||
return $this->rawFormat('D, M j, Y');
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as time
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toTimeString();
|
||||
* ```
|
||||
*/
|
||||
public function toTimeString(string $unitPrecision = 'second'): string
|
||||
{
|
||||
return $this->rawFormat(static::getTimeFormatByPrecision($unitPrecision));
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as date and time
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toDateTimeString();
|
||||
* ```
|
||||
*/
|
||||
public function toDateTimeString(string $unitPrecision = 'second'): string
|
||||
{
|
||||
return $this->rawFormat('Y-m-d '.static::getTimeFormatByPrecision($unitPrecision));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a format from H:i to H:i:s.u according to given unit precision.
|
||||
*
|
||||
* @param string $unitPrecision "minute", "second", "millisecond" or "microsecond"
|
||||
*/
|
||||
public static function getTimeFormatByPrecision(string $unitPrecision): string
|
||||
{
|
||||
return match (static::singularUnit($unitPrecision)) {
|
||||
'minute' => 'H:i',
|
||||
'second' => 'H:i:s',
|
||||
'm', 'millisecond' => 'H:i:s.v',
|
||||
'µ', 'microsecond' => 'H:i:s.u',
|
||||
default => throw new UnitException('Precision unit expected among: minute, second, millisecond and microsecond.'),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as date and time T-separated with no timezone
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toDateTimeLocalString();
|
||||
* echo "\n";
|
||||
* echo Carbon::now()->toDateTimeLocalString('minute'); // You can specify precision among: minute, second, millisecond and microsecond
|
||||
* ```
|
||||
*/
|
||||
public function toDateTimeLocalString(string $unitPrecision = 'second'): string
|
||||
{
|
||||
return $this->rawFormat('Y-m-d\T'.static::getTimeFormatByPrecision($unitPrecision));
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance with day, date and time
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toDayDateTimeString();
|
||||
* ```
|
||||
*/
|
||||
public function toDayDateTimeString(): string
|
||||
{
|
||||
return $this->rawFormat('D, M j, Y g:i A');
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as ATOM
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toAtomString();
|
||||
* ```
|
||||
*/
|
||||
public function toAtomString(): string
|
||||
{
|
||||
return $this->rawFormat(DateTime::ATOM);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as COOKIE
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toCookieString();
|
||||
* ```
|
||||
*/
|
||||
public function toCookieString(): string
|
||||
{
|
||||
return $this->rawFormat(DateTimeInterface::COOKIE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as ISO8601
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toIso8601String();
|
||||
* ```
|
||||
*/
|
||||
public function toIso8601String(): string
|
||||
{
|
||||
return $this->toAtomString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as RFC822
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toRfc822String();
|
||||
* ```
|
||||
*/
|
||||
public function toRfc822String(): string
|
||||
{
|
||||
return $this->rawFormat(DateTimeInterface::RFC822);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance to UTC and return as Zulu ISO8601
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toIso8601ZuluString();
|
||||
* ```
|
||||
*/
|
||||
public function toIso8601ZuluString(string $unitPrecision = 'second'): string
|
||||
{
|
||||
return $this->avoidMutation()
|
||||
->utc()
|
||||
->rawFormat('Y-m-d\T'.static::getTimeFormatByPrecision($unitPrecision).'\Z');
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as RFC850
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toRfc850String();
|
||||
* ```
|
||||
*/
|
||||
public function toRfc850String(): string
|
||||
{
|
||||
return $this->rawFormat(DateTimeInterface::RFC850);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as RFC1036
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toRfc1036String();
|
||||
* ```
|
||||
*/
|
||||
public function toRfc1036String(): string
|
||||
{
|
||||
return $this->rawFormat(DateTimeInterface::RFC1036);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as RFC1123
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toRfc1123String();
|
||||
* ```
|
||||
*/
|
||||
public function toRfc1123String(): string
|
||||
{
|
||||
return $this->rawFormat(DateTimeInterface::RFC1123);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as RFC2822
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toRfc2822String();
|
||||
* ```
|
||||
*/
|
||||
public function toRfc2822String(): string
|
||||
{
|
||||
return $this->rawFormat(DateTimeInterface::RFC2822);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as RFC3339.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toRfc3339String() . "\n";
|
||||
* echo Carbon::now()->toRfc3339String(true) . "\n";
|
||||
* ```
|
||||
*/
|
||||
public function toRfc3339String(bool $extended = false): string
|
||||
{
|
||||
return $this->rawFormat($extended ? DateTimeInterface::RFC3339_EXTENDED : DateTimeInterface::RFC3339);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as RSS
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toRssString();
|
||||
* ```
|
||||
*/
|
||||
public function toRssString(): string
|
||||
{
|
||||
return $this->rawFormat(DateTimeInterface::RSS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as W3C
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toW3cString();
|
||||
* ```
|
||||
*/
|
||||
public function toW3cString(): string
|
||||
{
|
||||
return $this->rawFormat(DateTimeInterface::W3C);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the instance as RFC7231
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toRfc7231String();
|
||||
* ```
|
||||
*/
|
||||
public function toRfc7231String(): string
|
||||
{
|
||||
return $this->avoidMutation()
|
||||
->setTimezone('GMT')
|
||||
->rawFormat(\defined('static::RFC7231_FORMAT') ? static::RFC7231_FORMAT : CarbonInterface::RFC7231_FORMAT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default array representation.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* var_dump(Carbon::now()->toArray());
|
||||
* ```
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
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->rawFormat(\defined('static::DEFAULT_TO_STRING_FORMAT') ? static::DEFAULT_TO_STRING_FORMAT : CarbonInterface::DEFAULT_TO_STRING_FORMAT),
|
||||
'timezone' => $this->timezone,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default object representation.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* var_dump(Carbon::now()->toObject());
|
||||
* ```
|
||||
*/
|
||||
public function toObject(): object
|
||||
{
|
||||
return (object) $this->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns english human-readable complete date string.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toString();
|
||||
* ```
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return $this->avoidMutation()->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).
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now('America/Toronto')->toISOString() . "\n";
|
||||
* echo Carbon::now('America/Toronto')->toISOString(true) . "\n";
|
||||
* ```
|
||||
*
|
||||
* @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC.
|
||||
*/
|
||||
public function toISOString(bool $keepOffset = false): ?string
|
||||
{
|
||||
if (!$this->isValid()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$yearFormat = $this->year < 0 || $this->year > 9999 ? 'YYYYYY' : 'YYYY';
|
||||
$timezoneFormat = $keepOffset ? 'Z' : '[Z]';
|
||||
$date = $keepOffset ? $this : $this->avoidMutation()->utc();
|
||||
|
||||
return $date->isoFormat("$yearFormat-MM-DD[T]HH:mm:ss.SSSSSS$timezoneFormat");
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now('America/Toronto')->toJSON();
|
||||
* ```
|
||||
*/
|
||||
public function toJSON(): ?string
|
||||
{
|
||||
return $this->toISOString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return native DateTime PHP object matching the current instance.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* var_dump(Carbon::now()->toDateTime());
|
||||
* ```
|
||||
*/
|
||||
public function toDateTime(): DateTime
|
||||
{
|
||||
return DateTime::createFromFormat('U.u', $this->rawFormat('U.u'))
|
||||
->setTimezone($this->getTimezone());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return native toDateTimeImmutable PHP object matching the current instance.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* var_dump(Carbon::now()->toDateTimeImmutable());
|
||||
* ```
|
||||
*/
|
||||
public function toDateTimeImmutable(): DateTimeImmutable
|
||||
{
|
||||
return DateTimeImmutable::createFromFormat('U.u', $this->rawFormat('U.u'))
|
||||
->setTimezone($this->getTimezone());
|
||||
}
|
||||
|
||||
/**
|
||||
* @alias toDateTime
|
||||
*
|
||||
* Return native DateTime PHP object matching the current instance.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* var_dump(Carbon::now()->toDate());
|
||||
* ```
|
||||
*/
|
||||
public function toDate(): DateTime
|
||||
{
|
||||
return $this->toDateTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
|
||||
*
|
||||
* @param \DateTimeInterface|Carbon|CarbonImmutable|int|null $end period end date or recurrences count if int
|
||||
* @param int|\DateInterval|string|null $interval period default interval or number of the given $unit
|
||||
* @param string|null $unit if specified, $interval must be an integer
|
||||
*/
|
||||
public function toPeriod($end = null, $interval = null, $unit = null): CarbonPeriod
|
||||
{
|
||||
if ($unit) {
|
||||
$interval = CarbonInterval::make("$interval ".static::pluralUnit($unit));
|
||||
}
|
||||
|
||||
$isDefaultInterval = !$interval;
|
||||
$interval ??= CarbonInterval::day();
|
||||
$class = $this->isMutable() ? CarbonPeriod::class : CarbonPeriodImmutable::class;
|
||||
|
||||
if (\is_int($end) || (\is_string($end) && ctype_digit($end))) {
|
||||
$end = (int) $end;
|
||||
}
|
||||
|
||||
$end ??= 1;
|
||||
|
||||
if (!\is_int($end)) {
|
||||
$end = $this->resolveCarbon($end);
|
||||
}
|
||||
|
||||
return new $class(
|
||||
raw: [$this, CarbonInterval::make($interval), $end],
|
||||
dateClass: static::class,
|
||||
isDefaultInterval: $isDefaultInterval,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
|
||||
*
|
||||
* @param \DateTimeInterface|Carbon|CarbonImmutable|null $end period end date
|
||||
* @param int|\DateInterval|string|null $interval period default interval or number of the given $unit
|
||||
* @param string|null $unit if specified, $interval must be an integer
|
||||
*/
|
||||
public function range($end = null, $interval = null, $unit = null): CarbonPeriod
|
||||
{
|
||||
return $this->toPeriod($end, $interval, $unit);
|
||||
}
|
||||
}
|
||||
+938
@@ -0,0 +1,938 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* 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 Carbon\Exceptions\InvalidDateException;
|
||||
use Carbon\Exceptions\InvalidFormatException;
|
||||
use Carbon\Exceptions\InvalidTimeZoneException;
|
||||
use Carbon\Exceptions\OutOfRangeException;
|
||||
use Carbon\Exceptions\UnitException;
|
||||
use Carbon\Month;
|
||||
use Carbon\Translator;
|
||||
use Carbon\WeekDay;
|
||||
use Closure;
|
||||
use DateMalformedStringException;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeInterface;
|
||||
use DateTimeZone;
|
||||
use Exception;
|
||||
use ReturnTypeWillChange;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* Trait Creator.
|
||||
*
|
||||
* Static creators.
|
||||
*
|
||||
* Depends on the following methods:
|
||||
*
|
||||
* @method static Carbon|CarbonImmutable getTestNow()
|
||||
*/
|
||||
trait Creator
|
||||
{
|
||||
use ObjectInitialisation;
|
||||
use LocalFactory;
|
||||
|
||||
/**
|
||||
* The errors that can occur.
|
||||
*/
|
||||
protected static ?array $lastErrors = null;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*/
|
||||
public function __construct(
|
||||
DateTimeInterface|WeekDay|Month|string|int|float|null $time = null,
|
||||
DateTimeZone|string|int|null $timezone = null,
|
||||
) {
|
||||
$this->initLocalFactory();
|
||||
|
||||
if ($time instanceof Month) {
|
||||
$time = $time->name.' 1';
|
||||
} elseif ($time instanceof WeekDay) {
|
||||
$time = $time->name;
|
||||
} elseif ($time instanceof DateTimeInterface) {
|
||||
$time = $this->constructTimezoneFromDateTime($time, $timezone)->format('Y-m-d H:i:s.u');
|
||||
}
|
||||
|
||||
if (\is_string($time) && str_starts_with($time, '@')) {
|
||||
$time = static::createFromTimestampUTC(substr($time, 1))->format('Y-m-d\TH:i:s.uP');
|
||||
} elseif (is_numeric($time) && (!\is_string($time) || !preg_match('/^\d{1,14}$/', $time))) {
|
||||
$time = static::createFromTimestampUTC($time)->format('Y-m-d\TH:i:s.uP');
|
||||
}
|
||||
|
||||
// If the class has a test now set, and we are trying to create a now()
|
||||
// instance then override as required
|
||||
$isNow = \in_array($time, [null, '', 'now'], true);
|
||||
$timezone = static::safeCreateDateTimeZone($timezone) ?? null;
|
||||
|
||||
if (
|
||||
($this->clock || (
|
||||
method_exists(static::class, 'hasTestNow') &&
|
||||
method_exists(static::class, 'getTestNow') &&
|
||||
static::hasTestNow()
|
||||
)) &&
|
||||
($isNow || static::hasRelativeKeywords($time))
|
||||
) {
|
||||
$this->mockConstructorParameters($time, $timezone);
|
||||
}
|
||||
|
||||
try {
|
||||
parent::__construct($time ?? 'now', $timezone);
|
||||
} catch (Exception $exception) {
|
||||
throw new InvalidFormatException($exception->getMessage(), 0, $exception);
|
||||
}
|
||||
|
||||
$this->constructedObjectId = spl_object_hash($this);
|
||||
|
||||
self::setLastErrors(parent::getLastErrors());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get timezone from a datetime instance.
|
||||
*/
|
||||
private function constructTimezoneFromDateTime(
|
||||
DateTimeInterface $date,
|
||||
DateTimeZone|string|int|null &$timezone,
|
||||
): DateTimeInterface {
|
||||
if ($timezone !== null) {
|
||||
$safeTz = static::safeCreateDateTimeZone($timezone);
|
||||
|
||||
if ($safeTz) {
|
||||
$date = ($date instanceof DateTimeImmutable ? $date : clone $date)->setTimezone($safeTz);
|
||||
}
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
$timezone = $date->getTimezone();
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update constructedObjectId on cloned.
|
||||
*/
|
||||
public function __clone(): void
|
||||
{
|
||||
$this->constructedObjectId = spl_object_hash($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a DateTime one.
|
||||
*/
|
||||
public static function instance(DateTimeInterface $date): static
|
||||
{
|
||||
if ($date instanceof static) {
|
||||
return clone $date;
|
||||
}
|
||||
|
||||
$instance = parent::createFromFormat('U.u', $date->format('U.u'))
|
||||
->setTimezone($date->getTimezone());
|
||||
|
||||
if ($date instanceof CarbonInterface) {
|
||||
$settings = $date->getSettings();
|
||||
|
||||
if (!$date->hasLocalTranslator()) {
|
||||
unset($settings['locale']);
|
||||
}
|
||||
|
||||
$instance->settings($settings);
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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().
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*/
|
||||
public static function rawParse(
|
||||
DateTimeInterface|WeekDay|Month|string|int|float|null $time,
|
||||
DateTimeZone|string|int|null $timezone = null,
|
||||
): static {
|
||||
if ($time instanceof DateTimeInterface) {
|
||||
return static::instance($time);
|
||||
}
|
||||
|
||||
try {
|
||||
return new static($time, $timezone);
|
||||
} catch (Exception $exception) {
|
||||
// @codeCoverageIgnoreStart
|
||||
try {
|
||||
$date = @static::now($timezone)->change($time);
|
||||
} catch (DateMalformedStringException|InvalidFormatException) {
|
||||
$date = null;
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return $date
|
||||
?? throw new InvalidFormatException("Could not parse '$time': ".$exception->getMessage(), 0, $exception);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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().
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*/
|
||||
public static function parse(
|
||||
DateTimeInterface|WeekDay|Month|string|int|float|null $time,
|
||||
DateTimeZone|string|int|null $timezone = null,
|
||||
): static {
|
||||
$function = static::$parseFunction;
|
||||
|
||||
if (!$function) {
|
||||
return static::rawParse($time, $timezone);
|
||||
}
|
||||
|
||||
if (\is_string($function) && method_exists(static::class, $function)) {
|
||||
$function = [static::class, $function];
|
||||
}
|
||||
|
||||
return $function(...\func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).
|
||||
*
|
||||
* @param string $time date/time string in the given language (may also contain English).
|
||||
* @param string|null $locale if locale is null or not specified, current global locale will be
|
||||
* used instead.
|
||||
* @param DateTimeZone|string|int|null $timezone optional timezone for the new instance.
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*/
|
||||
public static function parseFromLocale(
|
||||
string $time,
|
||||
?string $locale = null,
|
||||
DateTimeZone|string|int|null $timezone = null,
|
||||
): static {
|
||||
return static::rawParse(static::translateTimeString($time, $locale, static::DEFAULT_LOCALE), $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Carbon instance for the current date and time.
|
||||
*/
|
||||
public static function now(DateTimeZone|string|int|null $timezone = null): static
|
||||
{
|
||||
return new static(null, $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance for today.
|
||||
*/
|
||||
public static function today(DateTimeZone|string|int|null $timezone = null): static
|
||||
{
|
||||
return static::rawParse('today', $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance for tomorrow.
|
||||
*/
|
||||
public static function tomorrow(DateTimeZone|string|int|null $timezone = null): static
|
||||
{
|
||||
return static::rawParse('tomorrow', $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance for yesterday.
|
||||
*/
|
||||
public static function yesterday(DateTimeZone|string|int|null $timezone = null): static
|
||||
{
|
||||
return static::rawParse('yesterday', $timezone);
|
||||
}
|
||||
|
||||
private static function assertBetween($unit, $value, $min, $max): void
|
||||
{
|
||||
if (static::isStrictModeEnabled() && ($value < $min || $value > $max)) {
|
||||
throw new OutOfRangeException($unit, $min, $max, $value);
|
||||
}
|
||||
}
|
||||
|
||||
private static function createNowInstance($timezone)
|
||||
{
|
||||
if (!static::hasTestNow()) {
|
||||
return static::now($timezone);
|
||||
}
|
||||
|
||||
$now = static::getTestNow();
|
||||
|
||||
if ($now instanceof Closure) {
|
||||
return $now(static::now($timezone));
|
||||
}
|
||||
|
||||
$now = $now->avoidMutation();
|
||||
|
||||
return $timezone === null ? $now : $now->setTimezone($timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 DateTimeInterface|string|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|int|null $timezone
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null): ?self
|
||||
{
|
||||
$month = self::monthToInt($month);
|
||||
|
||||
if ((\is_string($year) && !is_numeric($year)) || $year instanceof DateTimeInterface) {
|
||||
return static::parse($year, $timezone ?? (\is_string($month) || $month instanceof DateTimeZone ? $month : null));
|
||||
}
|
||||
|
||||
$defaults = null;
|
||||
$getDefault = function ($unit) use ($timezone, &$defaults) {
|
||||
if ($defaults === null) {
|
||||
$now = self::createNowInstance($timezone);
|
||||
|
||||
$defaults = array_combine([
|
||||
'year',
|
||||
'month',
|
||||
'day',
|
||||
'hour',
|
||||
'minute',
|
||||
'second',
|
||||
], explode('-', $now->rawFormat('Y-n-j-G-i-s.u')));
|
||||
}
|
||||
|
||||
return $defaults[$unit];
|
||||
};
|
||||
|
||||
$year = $year ?? $getDefault('year');
|
||||
$month = $month ?? $getDefault('month');
|
||||
$day = $day ?? $getDefault('day');
|
||||
$hour = $hour ?? $getDefault('hour');
|
||||
$minute = $minute ?? $getDefault('minute');
|
||||
$second = (float) ($second ?? $getDefault('second'));
|
||||
|
||||
self::assertBetween('month', $month, 0, 99);
|
||||
self::assertBetween('day', $day, 0, 99);
|
||||
self::assertBetween('hour', $hour, 0, 99);
|
||||
self::assertBetween('minute', $minute, 0, 99);
|
||||
self::assertBetween('second', $second, 0, 99);
|
||||
|
||||
$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);
|
||||
$instance = static::rawCreateFromFormat('!Y-n-j G:i:s.u', \sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $timezone);
|
||||
|
||||
if ($instance && $fixYear !== null) {
|
||||
$instance = $instance->addYears($fixYear);
|
||||
}
|
||||
|
||||
return $instance ?? 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 InvalidDateException
|
||||
* 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|int|null $timezone
|
||||
*
|
||||
* @throws InvalidDateException
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null): ?self
|
||||
{
|
||||
$month = self::monthToInt($month);
|
||||
$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 null;
|
||||
}
|
||||
}
|
||||
|
||||
$instance = static::create($year, $month, $day, $hour, $minute, $second, $timezone);
|
||||
|
||||
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 null;
|
||||
}
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Carbon instance from a specific date and time using strict validation.
|
||||
*
|
||||
* @see create()
|
||||
*
|
||||
* @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|int|null $timezone
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null): static
|
||||
{
|
||||
$initialStrictMode = static::isStrictModeEnabled();
|
||||
static::useStrictMode(true);
|
||||
|
||||
try {
|
||||
$date = static::create($year, $month, $day, $hour, $minute, $second, $timezone);
|
||||
} finally {
|
||||
static::useStrictMode($initialStrictMode);
|
||||
}
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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|int|null $timezone
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function createFromDate($year = null, $month = null, $day = null, $timezone = null)
|
||||
{
|
||||
return static::create($year, $month, $day, null, null, null, $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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|int|null $timezone
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function createMidnightDate($year = null, $month = null, $day = null, $timezone = null)
|
||||
{
|
||||
return static::create($year, $month, $day, 0, 0, 0, $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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|int|null $timezone
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null): static
|
||||
{
|
||||
return static::create(null, null, null, $hour, $minute, $second, $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a time string. The date portion is set to today.
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*/
|
||||
public static function createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null): static
|
||||
{
|
||||
return static::today($timezone)->setTimeFromTimeString($time);
|
||||
}
|
||||
|
||||
private static function createFromFormatAndTimezone(
|
||||
string $format,
|
||||
string $time,
|
||||
DateTimeZone|string|int|null $originalTimezone,
|
||||
): ?DateTimeInterface {
|
||||
if ($originalTimezone === null) {
|
||||
return parent::createFromFormat($format, $time) ?: null;
|
||||
}
|
||||
|
||||
$timezone = \is_int($originalTimezone) ? self::getOffsetTimezone($originalTimezone) : $originalTimezone;
|
||||
|
||||
$timezone = static::safeCreateDateTimeZone($timezone, $originalTimezone);
|
||||
|
||||
return parent::createFromFormat($format, $time, $timezone) ?: null;
|
||||
}
|
||||
|
||||
private static function getOffsetTimezone(int $offset): string
|
||||
{
|
||||
$minutes = (int) ($offset * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE);
|
||||
|
||||
return @timezone_name_from_abbr('', $minutes, 1) ?: throw new InvalidTimeZoneException(
|
||||
"Invalid offset timezone $offset",
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific format.
|
||||
*
|
||||
* @param string $format Datetime format
|
||||
* @param string $time
|
||||
* @param DateTimeZone|string|int|null $timezone
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function rawCreateFromFormat(string $format, string $time, $timezone = null): ?self
|
||||
{
|
||||
// Work-around for https://bugs.php.net/bug.php?id=80141
|
||||
$format = preg_replace('/(?<!\\\\)((?:\\\\{2})*)c/', '$1Y-m-d\TH:i:sP', $format);
|
||||
|
||||
if (preg_match('/(?<!\\\\)(?:\\\\{2})*(a|A)/', $format, $aMatches, PREG_OFFSET_CAPTURE) &&
|
||||
preg_match('/(?<!\\\\)(?:\\\\{2})*(h|g|H|G)/', $format, $hMatches, PREG_OFFSET_CAPTURE) &&
|
||||
$aMatches[1][1] < $hMatches[1][1] &&
|
||||
preg_match('/(am|pm|AM|PM)/', $time)
|
||||
) {
|
||||
$format = preg_replace('/^(.*)(?<!\\\\)((?:\\\\{2})*)(a|A)(.*)$/U', '$1$2$4 $3', $format);
|
||||
$time = preg_replace('/^(.*)(am|pm|AM|PM)(.*)$/U', '$1$3 $2', $time);
|
||||
}
|
||||
|
||||
if ($timezone === false) {
|
||||
$timezone = null;
|
||||
}
|
||||
|
||||
// First attempt to create an instance, so that error messages are based on the unmodified format.
|
||||
$date = self::createFromFormatAndTimezone($format, $time, $timezone);
|
||||
$lastErrors = parent::getLastErrors();
|
||||
/** @var \Carbon\CarbonImmutable|\Carbon\Carbon|null $mock */
|
||||
$mock = static::getMockedTestNow($timezone);
|
||||
|
||||
if ($mock && $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 = '(?<!\\\\)(\\\\{2})*';
|
||||
|
||||
$nonIgnored = preg_replace("/^.*{$nonEscaped}!/s", '', $format);
|
||||
|
||||
if ($timezone === null && !preg_match("/{$nonEscaped}[eOPT]/", $nonIgnored)) {
|
||||
$timezone = clone $mock->getTimezone();
|
||||
}
|
||||
|
||||
$mock = $mock->copy();
|
||||
|
||||
// Prepend mock datetime only if the format does not contain non escaped unix epoch reset flag.
|
||||
if (!preg_match("/{$nonEscaped}[!|]/", $format)) {
|
||||
if (preg_match('/[HhGgisvuB]/', $format)) {
|
||||
$mock = $mock->setTime(0, 0);
|
||||
}
|
||||
|
||||
$format = static::MOCK_DATETIME_FORMAT.' '.$format;
|
||||
$time = ($mock instanceof self ? $mock->rawFormat(static::MOCK_DATETIME_FORMAT) : $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, $timezone);
|
||||
}
|
||||
|
||||
if ($date instanceof DateTimeInterface) {
|
||||
$instance = static::instance($date);
|
||||
$instance::setLastErrors($lastErrors);
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
if (static::isStrictModeEnabled()) {
|
||||
throw new InvalidFormatException(implode(PHP_EOL, (array) $lastErrors['errors']));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific format.
|
||||
*
|
||||
* @param string $format Datetime format
|
||||
* @param string $time
|
||||
* @param DateTimeZone|string|int|null $timezone
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public static function createFromFormat($format, $time, $timezone = null): ?self
|
||||
{
|
||||
$function = static::$createFromFormatFunction;
|
||||
|
||||
// format is a single numeric unit
|
||||
if (\is_int($time) && \in_array(ltrim($format, '!'), ['U', 'Y', 'y', 'X', 'x', 'm', 'n', 'd', 'j', 'w', 'W', 'H', 'h', 'G', 'g', 'i', 's', 'u', 'z', 'v'], true)) {
|
||||
$time = (string) $time;
|
||||
}
|
||||
|
||||
if (!\is_string($time)) {
|
||||
@trigger_error(
|
||||
'createFromFormat() $time parameter will only accept string or integer for 1-letter format representing a numeric unit in the next version',
|
||||
\E_USER_DEPRECATED,
|
||||
);
|
||||
$time = (string) $time;
|
||||
}
|
||||
|
||||
if (!$function) {
|
||||
return static::rawCreateFromFormat($format, $time, $timezone);
|
||||
}
|
||||
|
||||
if (\is_string($function) && method_exists(static::class, $function)) {
|
||||
$function = [static::class, $function];
|
||||
}
|
||||
|
||||
return $function(...\func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).
|
||||
*
|
||||
* @param string $format Datetime format
|
||||
* @param string $time
|
||||
* @param DateTimeZone|string|int|null $timezone optional timezone
|
||||
* @param string|null $locale locale to be used for LTS, LT, LL, LLL, etc. macro-formats (en by fault, unneeded if no such macro-format in use)
|
||||
* @param TranslatorInterface|null $translator optional custom translator to use for macro-formats
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function createFromIsoFormat(
|
||||
string $format,
|
||||
string $time,
|
||||
$timezone = null,
|
||||
?string $locale = self::DEFAULT_LOCALE,
|
||||
?TranslatorInterface $translator = null
|
||||
): ?self {
|
||||
$format = preg_replace_callback('/(?<!\\\\)(\\\\{2})*(LTS|LT|[Ll]{1,4})/', function ($match) use ($locale, $translator) {
|
||||
[$code] = $match;
|
||||
|
||||
static $formats = null;
|
||||
|
||||
if ($formats === null) {
|
||||
$translator ??= Translator::get($locale);
|
||||
|
||||
$formats = [
|
||||
'LT' => static::getTranslationMessageWith($translator, 'formats.LT', $locale),
|
||||
'LTS' => static::getTranslationMessageWith($translator, 'formats.LTS', $locale),
|
||||
'L' => static::getTranslationMessageWith($translator, 'formats.L', $locale),
|
||||
'LL' => static::getTranslationMessageWith($translator, 'formats.LL', $locale),
|
||||
'LLL' => static::getTranslationMessageWith($translator, 'formats.LLL', $locale),
|
||||
'LLLL' => static::getTranslationMessageWith($translator, 'formats.LLLL', $locale),
|
||||
];
|
||||
}
|
||||
|
||||
return $formats[$code] ?? preg_replace_callback(
|
||||
'/MMMM|MM|DD|dddd/',
|
||||
static fn (array $code) => mb_substr($code[0], 1),
|
||||
$formats[strtoupper($code)] ?? '',
|
||||
);
|
||||
}, $format);
|
||||
|
||||
$format = preg_replace_callback('/(?<!\\\\)(\\\\{2})*('.CarbonInterface::ISO_FORMAT_REGEXP.'|[A-Za-z])/', function ($match) {
|
||||
[$code] = $match;
|
||||
|
||||
static $replacements = null;
|
||||
|
||||
if ($replacements === null) {
|
||||
$replacements = [
|
||||
'OD' => 'd',
|
||||
'OM' => 'M',
|
||||
'OY' => 'Y',
|
||||
'OH' => 'G',
|
||||
'Oh' => 'g',
|
||||
'Om' => 'i',
|
||||
'Os' => 's',
|
||||
'D' => 'd',
|
||||
'DD' => 'd',
|
||||
'Do' => 'd',
|
||||
'd' => '!',
|
||||
'dd' => '!',
|
||||
'ddd' => 'D',
|
||||
'dddd' => 'D',
|
||||
'DDD' => 'z',
|
||||
'DDDD' => 'z',
|
||||
'DDDo' => 'z',
|
||||
'e' => '!',
|
||||
'E' => '!',
|
||||
'H' => 'G',
|
||||
'HH' => 'H',
|
||||
'h' => 'g',
|
||||
'hh' => 'h',
|
||||
'k' => 'G',
|
||||
'kk' => 'G',
|
||||
'hmm' => 'gi',
|
||||
'hmmss' => 'gis',
|
||||
'Hmm' => 'Gi',
|
||||
'Hmmss' => 'Gis',
|
||||
'm' => 'i',
|
||||
'mm' => 'i',
|
||||
'a' => 'a',
|
||||
'A' => 'a',
|
||||
's' => 's',
|
||||
'ss' => 's',
|
||||
'S' => '*',
|
||||
'SS' => '*',
|
||||
'SSS' => '*',
|
||||
'SSSS' => '*',
|
||||
'SSSSS' => '*',
|
||||
'SSSSSS' => 'u',
|
||||
'SSSSSSS' => 'u*',
|
||||
'SSSSSSSS' => 'u*',
|
||||
'SSSSSSSSS' => 'u*',
|
||||
'M' => 'm',
|
||||
'MM' => 'm',
|
||||
'MMM' => 'M',
|
||||
'MMMM' => 'M',
|
||||
'Mo' => 'm',
|
||||
'Q' => '!',
|
||||
'Qo' => '!',
|
||||
'G' => '!',
|
||||
'GG' => '!',
|
||||
'GGG' => '!',
|
||||
'GGGG' => '!',
|
||||
'GGGGG' => '!',
|
||||
'g' => '!',
|
||||
'gg' => '!',
|
||||
'ggg' => '!',
|
||||
'gggg' => '!',
|
||||
'ggggg' => '!',
|
||||
'W' => '!',
|
||||
'WW' => '!',
|
||||
'Wo' => '!',
|
||||
'w' => '!',
|
||||
'ww' => '!',
|
||||
'wo' => '!',
|
||||
'x' => 'U???',
|
||||
'X' => 'U',
|
||||
'Y' => 'Y',
|
||||
'YY' => 'y',
|
||||
'YYYY' => 'Y',
|
||||
'YYYYY' => 'Y',
|
||||
'YYYYYY' => 'Y',
|
||||
'z' => 'e',
|
||||
'zz' => 'e',
|
||||
'Z' => 'e',
|
||||
'ZZ' => 'e',
|
||||
];
|
||||
}
|
||||
|
||||
$format = $replacements[$code] ?? '?';
|
||||
|
||||
if ($format === '!') {
|
||||
throw new InvalidFormatException("Format $code not supported for creation.");
|
||||
}
|
||||
|
||||
return $format;
|
||||
}, $format);
|
||||
|
||||
return static::rawCreateFromFormat($format, $time, $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific format and a string in a given language.
|
||||
*
|
||||
* @param string $format Datetime format
|
||||
* @param string $locale
|
||||
* @param string $time
|
||||
* @param DateTimeZone|string|int|null $timezone
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null): ?self
|
||||
{
|
||||
$format = preg_replace_callback(
|
||||
'/(?:\\\\[a-zA-Z]|[bfkqCEJKQRV]){2,}/',
|
||||
static function (array $match) use ($locale): string {
|
||||
$word = str_replace('\\', '', $match[0]);
|
||||
$translatedWord = static::translateTimeString($word, $locale, static::DEFAULT_LOCALE);
|
||||
|
||||
return $word === $translatedWord
|
||||
? $match[0]
|
||||
: preg_replace('/[a-zA-Z]/', '\\\\$0', $translatedWord);
|
||||
},
|
||||
$format
|
||||
);
|
||||
|
||||
return static::rawCreateFromFormat($format, static::translateTimeString($time, $locale, static::DEFAULT_LOCALE), $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific ISO format and a string in a given language.
|
||||
*
|
||||
* @param string $format Datetime ISO format
|
||||
* @param string $locale
|
||||
* @param string $time
|
||||
* @param DateTimeZone|string|int|null $timezone
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null): ?self
|
||||
{
|
||||
$time = static::translateTimeString($time, $locale, static::DEFAULT_LOCALE, CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS | CarbonInterface::TRANSLATE_MERIDIEM);
|
||||
|
||||
return static::createFromIsoFormat($format, $time, $timezone, $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function make($var, DateTimeZone|string|null $timezone = null): ?self
|
||||
{
|
||||
if ($var instanceof DateTimeInterface) {
|
||||
return static::instance($var);
|
||||
}
|
||||
|
||||
$date = null;
|
||||
|
||||
if (\is_string($var)) {
|
||||
$var = trim($var);
|
||||
|
||||
if (!preg_match('/^P[\dT]/', $var) &&
|
||||
!preg_match('/^R\d/', $var) &&
|
||||
preg_match('/[a-z\d]/i', $var)
|
||||
) {
|
||||
$date = static::parse($var, $timezone);
|
||||
}
|
||||
}
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set last errors.
|
||||
*
|
||||
* @param array|bool $lastErrors
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function setLastErrors($lastErrors): void
|
||||
{
|
||||
if (\is_array($lastErrors) || $lastErrors === false) {
|
||||
static::$lastErrors = \is_array($lastErrors) ? $lastErrors : [
|
||||
'warning_count' => 0,
|
||||
'warnings' => [],
|
||||
'error_count' => 0,
|
||||
'errors' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function getLastErrors(): array|false
|
||||
{
|
||||
return static::$lastErrors ?? false;
|
||||
}
|
||||
|
||||
private static function monthToInt(mixed $value, string $unit = 'month'): mixed
|
||||
{
|
||||
if ($value instanceof Month) {
|
||||
if ($unit !== 'month') {
|
||||
throw new UnitException("Month enum cannot be used to set $unit");
|
||||
}
|
||||
|
||||
return Month::int($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
+2971
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user