From 2ecd19e3b61fc1bcd8f237da049d745a13bc7716 Mon Sep 17 00:00:00 2001 From: kylekatarnls Date: Thu, 10 Oct 2024 00:30:45 +0200 Subject: [PATCH] Update documentation --- docs/index.html | 94 ++++++++++++++++++++++++------------------------- index.html | 40 +++++++++++---------- 2 files changed, 68 insertions(+), 66 deletions(-) diff --git a/docs/index.html b/docs/index.html index c63ba4cdc0..59effb3c68 100644 --- a/docs/index.html +++ b/docs/index.html @@ -133,13 +133,13 @@

Introduction

$modifiedImmutable = CarbonImmutable::now()->add(1, 'day'); var_dump($modifiedMutable === $mutable); // bool(true) -var_dump($mutable->isoFormat('dddd D')); // string(12) "Wednesday 25" -var_dump($modifiedMutable->isoFormat('dddd D')); // string(12) "Wednesday 25" +var_dump($mutable->isoFormat('dddd D')); // string(11) "Thursday 10" +var_dump($modifiedMutable->isoFormat('dddd D')); // string(11) "Thursday 10" // So it means $mutable and $modifiedMutable are the same object // both set to now + 1 day. var_dump($modifiedImmutable === $immutable); // bool(false) -var_dump($immutable->isoFormat('dddd D')); // string(10) "Tuesday 24" -var_dump($modifiedImmutable->isoFormat('dddd D')); // string(12) "Wednesday 25" +var_dump($immutable->isoFormat('dddd D')); // string(11) "Wednesday 9" +var_dump($modifiedImmutable->isoFormat('dddd D')); // string(11) "Thursday 10" // While $immutable is still set to now and cannot be changed and // $modifiedImmutable is a new instance created from $immutable // set to now + 1 day. @@ -281,16 +281,16 @@

Instantiation

$now = Carbon::now();
-echo $now;                               // 2024-09-24 09:21:00
+echo $now;                               // 2024-10-09 22:29:15
 echo "\n";
 $today = Carbon::today();
-echo $today;                             // 2024-09-24 00:00:00
+echo $today;                             // 2024-10-09 00:00:00
 echo "\n";
 $tomorrow = Carbon::tomorrow('Europe/London');
-echo $tomorrow;                          // 2024-09-25 00:00:00
+echo $tomorrow;                          // 2024-10-10 00:00:00
 echo "\n";
 $yesterday = Carbon::yesterday();
-echo $yesterday;                         // 2024-09-23 00:00:00
+echo $yesterday;                         // 2024-10-08 00:00:00
 

@@ -451,7 +451,7 @@

Instantiation

// 19:15 in Johannesburg echo 'Meeting starts at '.$meeting->format('H:i').' in Johannesburg.'; // Meeting starts at 19:15 in Johannesburg. // now in Johannesburg -echo "It's ".$meeting->nowWithSameTz()->format('H:i').' right now in Johannesburg.'; // It's 11:21 right now in Johannesburg. +echo "It's ".$meeting->nowWithSameTz()->format('H:i').' right now in Johannesburg.'; // It's 00:29 right now in Johannesburg.

@@ -703,9 +703,9 @@

Localization

echo "\n"; echo $date->diffForHumans(); // il y a 0 seconde echo "\n"; -echo $date->monthName; // septembre +echo $date->monthName; // octobre echo "\n"; -echo $date->isoFormat('LLLL'); // mardi 24 septembre 2024 09:21 +echo $date->isoFormat('LLLL'); // mercredi 9 octobre 2024 22:29

@@ -736,13 +736,13 @@

Localization

echo $toDisplay; /* 15 juin 2018 14:34 -Aujourd’hui à 11:21 +Aujourd’hui à 00:29 */ echo $notificationForJohn; /* Jun 15, 2018 7:34 AM -Today at 4:21 AM +Today at 5:29 PM */

@@ -769,9 +769,9 @@

Localization

]); // Important note: timezone setting calls ->shiftTimezone() and not ->setTimezone(), // It means it does not just set the timezone, but shift the time too: -echo Carbon::today()->setTimezone('Asia/Tokyo')->format('d/m G\h e'); // 24/09 9h Asia/Tokyo +echo Carbon::today()->setTimezone('Asia/Tokyo')->format('d/m G\h e'); // 09/10 9h Asia/Tokyo echo "\n"; -echo Carbon::today()->shiftTimezone('Asia/Tokyo')->format('d/m G\h e'); // 24/09 0h Asia/Tokyo +echo Carbon::today()->shiftTimezone('Asia/Tokyo')->format('d/m G\h e'); // 09/10 0h Asia/Tokyo // You can find back which factory created a given object: $a = $factory->now(); @@ -1654,21 +1654,21 @@

Localization

$date = CarbonImmutable::now();
-echo $date->calendar();                                      // Today at 9:21 AM
+echo $date->calendar();                                      // Today at 10:29 PM
 echo "\n";
-echo $date->sub('1 day 3 hours')->calendar();                // Yesterday at 6:21 AM
+echo $date->sub('1 day 3 hours')->calendar();                // Yesterday at 7:29 PM
 echo "\n";
-echo $date->sub('3 days 10 hours 23 minutes')->calendar();   // Last Friday at 10:58 PM
+echo $date->sub('3 days 10 hours 23 minutes')->calendar();   // Last Sunday at 12:06 PM
 echo "\n";
-echo $date->sub('8 days')->calendar();                       // 09/16/2024
+echo $date->sub('8 days')->calendar();                       // 10/01/2024
 echo "\n";
-echo $date->add('1 day 3 hours')->calendar();                // Tomorrow at 12:21 PM
+echo $date->add('1 day 3 hours')->calendar();                // Friday at 1:29 AM
 echo "\n";
-echo $date->add('3 days 10 hours 23 minutes')->calendar();   // Friday at 7:44 PM
+echo $date->add('3 days 10 hours 23 minutes')->calendar();   // Sunday at 8:52 AM
 echo "\n";
-echo $date->add('8 days')->calendar();                       // 10/02/2024
+echo $date->add('8 days')->calendar();                       // 10/17/2024
 echo "\n";
-echo $date->locale('fr')->calendar();                        // Aujourd’hui à 09:21
+echo $date->locale('fr')->calendar();                        // Aujourd’hui à 22:29
 

@@ -5588,7 +5588,7 @@

Testing Aids

var_dump(Carbon::hasTestNow()); // bool(true) Carbon::setTestNow(); // clear the mock var_dump(Carbon::hasTestNow()); // bool(false) -echo Carbon::now(); // 2024-09-24 09:21:01 +echo Carbon::now(); // 2024-10-09 22:29:17 // Instead of mock and clear mock, you also can use withTestNow(): Carbon::withTestNow('2010-09-15', static function () { @@ -5831,12 +5831,12 @@

Getters

// You can get any property dynamically too: $unit = 'second'; -var_dump(Carbon::now()->get($unit)); // int(1) +var_dump(Carbon::now()->get($unit)); // int(17) // equivalent to: -var_dump(Carbon::now()->$unit); // int(1) +var_dump(Carbon::now()->$unit); // int(17) // If you have plural unit name, use singularUnit() $unit = Carbon::singularUnit('seconds'); -var_dump(Carbon::now()->get($unit)); // int(1) +var_dump(Carbon::now()->get($unit)); // int(17) // Prefer using singularUnit() because some plurals are not the word with S: var_dump(Carbon::pluralUnit('century')); // string(9) "centuries" var_dump(Carbon::pluralUnit('millennium')); // string(9) "millennia" @@ -5912,23 +5912,23 @@

Weeks

var_dump($en->firstWeekDay); // int(0) var_dump($en->lastWeekDay); // int(6) -var_dump($en->startOfWeek()->format('Y-m-d H:i')); // string(16) "2024-09-22 00:00" -var_dump($en->endOfWeek()->format('Y-m-d H:i')); // string(16) "2024-09-28 23:59" +var_dump($en->startOfWeek()->format('Y-m-d H:i')); // string(16) "2024-10-06 00:00" +var_dump($en->endOfWeek()->format('Y-m-d H:i')); // string(16) "2024-10-12 23:59" echo "-----------\n"; // We still can force to use an other day as start/end of week $start = $en->startOfWeek(Carbon::TUESDAY); $end = $en->endOfWeek(Carbon::MONDAY); -var_dump($start->format('Y-m-d H:i')); // string(16) "2024-09-24 00:00" -var_dump($end->format('Y-m-d H:i')); // string(16) "2024-09-30 23:59" +var_dump($start->format('Y-m-d H:i')); // string(16) "2024-10-08 00:00" +var_dump($end->format('Y-m-d H:i')); // string(16) "2024-10-14 23:59" echo "-----------\n"; var_dump($ar->firstWeekDay); // int(6) var_dump($ar->lastWeekDay); // int(5) -var_dump($ar->startOfWeek()->format('Y-m-d H:i')); // string(16) "2024-09-21 00:00" -var_dump($ar->endOfWeek()->format('Y-m-d H:i')); // string(16) "2024-09-27 23:59" +var_dump($ar->startOfWeek()->format('Y-m-d H:i')); // string(16) "2024-10-05 00:00" +var_dump($ar->endOfWeek()->format('Y-m-d H:i')); // string(16) "2024-10-11 23:59" $en = CarbonImmutable::parse('2015-02-05'); // use en_US as default locale @@ -6413,8 +6413,8 @@

Comparison

// now is the default param $dt1 = Carbon::createMidnightDate(2000, 1, 1); -echo $dt1->max(); // 2024-09-24 09:21:01 -echo $dt1->maximum(); // 2024-09-24 09:21:01 +echo $dt1->max(); // 2024-10-09 22:29:17 +echo $dt1->maximum(); // 2024-10-09 22:29:17 // Remember min and max PHP native function work fine with dates too: echo max(Carbon::create('2002-03-15'), Carbon::create('2003-01-07'), Carbon::create('2002-08-25')); // 2003-01-07 00:00:00 @@ -6909,7 +6909,7 @@

Difference

greater than the other.

-

echo Carbon::now('America/Vancouver')->diffInSeconds(Carbon::now('Europe/London')); // 1.0E-5
+    
echo Carbon::now('America/Vancouver')->diffInSeconds(Carbon::now('Europe/London')); // 9.0E-6
 
 $dtOttawa = Carbon::createMidnightDate(2000, 1, 1, 'America/Toronto');
 $dtVancouver = Carbon::createMidnightDate(2000, 1, 1, 'America/Vancouver');
@@ -7048,10 +7048,10 @@ 

Difference

$date = Carbon::now()->addSeconds(3666); -echo $date->diffInSeconds(); // -3665.999871 -echo $date->diffInMinutes(); // -61.0999962 -echo $date->diffInHours(); // -1.0183332469444 -echo $date->diffInDays(); // -0.042430551006944 +echo $date->diffInSeconds(); // -3665.99991 +echo $date->diffInMinutes(); // -61.0999969 +echo $date->diffInHours(); // -1.0183332591667 +echo $date->diffInDays(); // -0.042430551574074 $date = Carbon::create(2016, 1, 5, 22, 40, 32); @@ -7704,9 +7704,9 @@

Macro

// Then now you can easily display any date in a page/e-mail using those user settings and the chosen format echo Carbon::parse($dateString, 'UTC')->formatForUser(); // 23/01/2010 echo "\n"; -echo Carbon::tomorrow()->formatForUser(); // Demain à 02:00 +echo Carbon::tomorrow()->formatForUser(); // Aujourd’hui à 02:00 echo "\n"; -echo Carbon::now()->subDays(3)->formatForUser(); // samedi dernier à 11:21 +echo Carbon::now()->subDays(3)->formatForUser(); // lundi dernier à 00:29

@@ -7969,10 +7969,10 @@

Macro

echo substr(implode(', ', $dates), 0, 100).'...'; } -dumpDateList(Carbon::getCurrentWeekDays()); // 2024-09-23 00:00:00, 2024-09-24 00:00:00, 2024-09-25 00:00:00, 2024-09-26 00:00:00, 2024-09-27 00:00... -dumpDateList(Carbon::getCurrentMonthDays()); // 2024-09-01 00:00:00, 2024-09-02 00:00:00, 2024-09-03 00:00:00, 2024-09-04 00:00:00, 2024-09-05 00:00... -dumpDateList(Carbon::now()->subMonth()->getCurrentWeekDays()); // 2024-08-19 00:00:00, 2024-08-20 00:00:00, 2024-08-21 00:00:00, 2024-08-22 00:00:00, 2024-08-23 00:00... -dumpDateList(Carbon::now()->subMonth()->getCurrentMonthDays()); // 2024-08-01 00:00:00, 2024-08-02 00:00:00, 2024-08-03 00:00:00, 2024-08-04 00:00:00, 2024-08-05 00:00... +dumpDateList(Carbon::getCurrentWeekDays()); // 2024-10-07 00:00:00, 2024-10-08 00:00:00, 2024-10-09 00:00:00, 2024-10-10 00:00:00, 2024-10-11 00:00... +dumpDateList(Carbon::getCurrentMonthDays()); // 2024-10-01 00:00:00, 2024-10-02 00:00:00, 2024-10-03 00:00:00, 2024-10-04 00:00:00, 2024-10-05 00:00... +dumpDateList(Carbon::now()->subMonth()->getCurrentWeekDays()); // 2024-09-09 00:00:00, 2024-09-10 00:00:00, 2024-09-11 00:00:00, 2024-09-12 00:00:00, 2024-09-13 00:00... +dumpDateList(Carbon::now()->subMonth()->getCurrentMonthDays()); // 2024-09-01 00:00:00, 2024-09-02 00:00:00, 2024-09-03 00:00:00, 2024-09-04 00:00:00, 2024-09-05 00:00...

@@ -8951,7 +8951,7 @@

CarbonPeriod

$days[] = $date->format('Y-m-d'); } -echo implode(', ', $days); // 2024-09-24, 2024-09-25, 2024-09-26 +echo implode(', ', $days); // 2024-10-09, 2024-10-10, 2024-10-11

diff --git a/index.html b/index.html index 35cb39980e..0140d2ca31 100644 --- a/index.html +++ b/index.html @@ -216,22 +216,22 @@

Sponsors

Онлайн казино 777 Best non Gamstop sites in the UK - Real Money Pokies Non GamStop Bookies UK + Real Money Pokies CasinoHex Canada Best non Gamstop sites in the UK - Real Money Pokies Non GamStop Bookies UK + Sportsbook Reviews Online Route4Me Route Planner Probukmacher Casino-portugal.pt - casinorevisor.com inkedin Онлайн казино України OnlineCasinosSpelen - Онлайн Казино Украины + casinorevisor.com Guidebook.BetWinner - Sportsbook Reviews Online + Онлайн Казино Украины + Real Money Pokies Non-GamStop Bets UK Online Kasyno Polis @@ -243,6 +243,7 @@

Backers

+ Parimatch Online casino zonder CRUKS jules Buy Crypto No Kyc @@ -258,57 +259,58 @@

Backers

IT-Manuals Siti-Non-AAMS.bet Siti Non AAMS - best cs2 keyboards meilleur jeux casino en ligne Que Narras Tomba.io - Coffee Saving Youtube True View Buy Instagram Followers Twicsy + ZonaMinecraft

+ Hitta rabattkod + vader 4 pro + Jämför försäkringar DevITJobs.com - Casinos That Accept GamStop Players - Proxidize Chudovo - Jämför försäkringar - Hitta rabattkod + Proxidize + Casinos That Accept GamStop Players SSSTwitter + Coffee Saving Triplebyte - Migliori Siti Non AAMS OnlineCasinoProfy Triplebyte Anna Filina + Migliori Siti Non AAMS Kamol Chalermviriya Hall Effect Game Controllers matej_j + AzuraCast GreenPromoCode.com + Dolphin IgAnony - AzuraCast - Vancouver Coir Instagram Story Viewer - Dolphin + Vancouver Coir + Organic Social Boost GermanTechJobs DevITJobs.uk - Organic Social Boost Wooting Alternatives Runxi Ding GitHub Sponsors - Wagerbit Roberto Guido Collins Agbonghama Real Targeted Traffic TargetedVisitors BB Creative Solutions - GlitteringGenerality Sunset City Mushrooms TikTokFame + GlitteringGenerality + Wagerbit People Search + IG Downloader Instagram Story Viewer Salesforce - IG Downloader Bishop Bettini Alberto Fortin Mike Healy