Compare commits

..

1 Commits

Author SHA1 Message Date
Deon George
a4650f8710 Add Carbon::quarter_string 2021-08-23 15:22:51 +10:00

View File

@@ -15,10 +15,13 @@ class Carbon extends CarbonBase
public function __get($name) public function __get($name)
{ {
switch (true) { switch ($name) {
case $name === 'half': case 'half':
return (int) ceil($this->month / static::MONTHS_PER_HALF); return (int) ceil($this->month / static::MONTHS_PER_HALF);
case 'quarter_string':
return sprintf('%dQ%d',$this->year,$this->quarter);
default: default:
return parent::__get($name); return parent::__get($name);
} }