diff --git a/Datatypes/SmartDateTime.php b/Datatypes/SmartDateTime.php index b2505f9d4..edd8e4b53 100644 --- a/Datatypes/SmartDateTime.php +++ b/Datatypes/SmartDateTime.php @@ -116,6 +116,16 @@ class SmartDateTime extends \DateTime return $this; } + public function getEndOfMonth() : SmartDateTime + { + return new SmartDateTime($this->format('Y') . '-' . $this->format('m') . '-' . $this->getDaysOfMonth()); + } + + public function getStartOfMonth() : SmartDateTime + { + return new SmartDateTime($this->format('Y') . '-' . $this->format('m') . '-01'); + } + /** * Get days of current month *