From 24dc627d5853b03b13c9506e6a7914e6f84a25cd Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 12 Jan 2004 19:25:10 +0000 Subject: [PATCH] =?utf8?q?Date=20con=20m=C3=A9todos=20extra=20de=20Date=5F?= =?utf8?q?Calc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/MECON/Date.php | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 lib/MECON/Date.php diff --git a/lib/MECON/Date.php b/lib/MECON/Date.php new file mode 100644 index 0000000..8f026a5 --- /dev/null +++ b/lib/MECON/Date.php @@ -0,0 +1,87 @@ + +------------------------------------------------------------------------------- +$Id: DBO.php 361 2003-10-06 16:56:46Z llucar $ +-----------------------------------------------------------------------------*/ + +require_once 'Date.php'; +require_once 'Date/Calc.php'; + +/** + * Clase de manejo de fechas con algunos extra features. + * + * @access public + */ +class MECON_Date extends Date { + + /** + * Obtiene la fecha de inicio del próximo mes. + * + * @return MECON_Date. + * @access public + */ + function getBeginOfNextMonth() + { + return new MECON_Date(Date_Calc::beginOfNextMonth( + $this->day, $this->month, $this->year, '%Y-%m-%d')); + } + + /** + * Obtiene la fecha de fin del próximo mes. + * + * @return MECON_Date. + * @access public + */ + function getEndOfNextMonth() + { + return new MECON_Date(Date_Calc::endOfNextMonth( + $this->day, $this->month, $this->year, '%Y-%m-%d')); + } + + /** + * Obtiene la fecha de inicio del mes anterior. + * + * @return MECON_Date. + * @access public + */ + function getBeginOfPrevMonth() + { + return new MECON_Date(Date_Calc::beginOfPrevMonth( + $this->day, $this->month, $this->year, '%Y-%m-%d')); + } + + /** + * Obtiene la fecha de fin del mes anterior. + * + * @return MECON_Date. + * @access public + */ + function getEndOfPrevMonth() + { + return new MECON_Date(Date_Calc::endOfPrevMonth( + $this->day, $this->month, $this->year, '%Y-%m-%d')); + } + +} + +?> \ No newline at end of file -- 2.43.0