dansoppelsa/laravel-carbon-macros

Laravel Carbon Macros

1.6.0 2022-07-22 18:15 UTC

README

Packagist Version GitHub Main Workflow Status Packagist License GitHub Contributors

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

Available Methods

Multi-National Dates

  • isNewYearsDay
  • isGoodFriday
  • isEasterSunday
  • isAllSaintsDay
  • isChristmasDay
  • isNewYearsEve

US Dates 🇺🇸

  • isMlkJrDay
  • isPresidentsDay
  • isMemorialDay
  • isIndependenceDay
  • isLaborDay
  • isColumbusDay
  • isVeteransDay
  • isAmericanThanksgiving

Canadian Dates 🇨🇦

  • isFamilyDay
  • isVictoriaDay
  • isCanadaDay
  • isCivicHoliday
  • isLabourDay
  • isCanadianThanksgiving
  • isRemembranceDay
  • isBoxingDay

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->isCanadaDay();
// false

$day->isNewYearsDay();
// false