Skip to content

A handy collection of Illuminate\Support\Carbon date helpers

License

Notifications You must be signed in to change notification settings

prakashchhetri/laravel-carbon-macros

 
 

Repository files navigation

Laravel Carbon Macros

Packagist Version GitHub Main Workflow Status Packagist License GitHub Contributors

A handy collection of international Illuminate\Support\Carbon date helpers

Available Methods

US Dates

  • isNewYearsDay
  • isMlkJrDay
  • isPresidentsDay
  • isGoodFriday
  • isEasterSunday
  • isMemorialDay
  • isIndependenceDay
  • isLaborDay
  • isColumbusDay
  • isVeteransDay
  • isAmericanThanksgiving
  • isChristmasDay
  • isNewYearsEve

Canadian Dates

  • isNewYearsDay
  • isFamilyDay
  • isGoodFriday
  • isEasterSunday
  • isVictoriaDay
  • isCanadaDay
  • isCivicHoliday
  • isLabourDay
  • isCanadianThanksgiving
  • isRemembranceDay
  • isChristmasDay
  • isBoxingDay
  • isNewYearsEve

Other Dates

Installation

Install via composer

composer require dansoppelsa/laravel-carbon-macros

Usage

<?php

use Illuminate\Support\Carbon;


$day = Carbon::parse('2020-12-25');

$day->isChristmasDay();
// true

$day->isNewYearsDay();
// false

About

A handy collection of Illuminate\Support\Carbon date helpers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%