defstudio/supercharged-carbon

A supercharged Carbon decorator

v2.0.0 2023-11-11 09:38 UTC

This package is auto-updated.

Last update: 2024-04-15 10:36:06 UTC


README

Carbon helper function

carbon('2018-04-18') returns a carbon instance

  • addWorkdays($count): self
  • isHoliday()
  • isWorkday()

italians holidays

  • isLiberationDay()
  • isRepublicDay()
  • isImmaculateConceptionFeast()
  • isAssumptionOfMaryFeast()
  • isEpiphany()
  • isDayBeforeChristmas()
  • isChristmas()
  • isSaintStephenDay()
  • isSaintSylvesterDay()
  • isWorkersDay()
  • isEasterDay()
  • isEasterMonday()

Upgrading

v1.x → v2.x

->isHoliday() does not answer true for Saturdays and Sundays, so, to obtain the same result as in v1.x this:

$date->isHoliday()

should be changed to:

!$date->isWorkday()

or

$date->isHoliday() || $date->isWeekend()