From 80a659d21aa2660ec4dad3a2aebe21126b77b3f7 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 14 Sep 2016 18:06:05 +0200 Subject: [PATCH] Added datetime functionality --- Datatypes/SmartDateTime.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 *