1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
4 -------------------------------------------------------------------------------
5 This file is part of mlib.
7 mlib is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your option)
12 mlib is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License; if not,
17 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------
20 Creado: vie nov 14 16:40:05 ART 2003
21 Autor: Leandro Lucarella <llucar@mecon.gov.ar>
22 -------------------------------------------------------------------------------
23 $Id: DBO.php 361 2003-10-06 16:56:46Z llucar $
24 -----------------------------------------------------------------------------*/
26 require_once 'Date.php';
27 require_once 'Date/Calc.php';
30 * Clase de manejo de fechas con algunos extra features.
34 class MLIB_Date extends Date {
37 * Obtiene la fecha de inicio del próximo mes.
42 function getBeginOfNextMonth()
44 return new MLIB_Date(Date_Calc::beginOfNextMonth(
45 $this->day, $this->month, $this->year, '%Y-%m-%d'));
49 * Obtiene la fecha de fin del próximo mes.
54 function getEndOfNextMonth()
56 return new MLIB_Date(Date_Calc::endOfNextMonth(
57 $this->day, $this->month, $this->year, '%Y-%m-%d'));
61 * Obtiene la fecha de inicio del mes anterior.
66 function getBeginOfPrevMonth()
68 return new MLIB_Date(Date_Calc::beginOfPrevMonth(
69 $this->day, $this->month, $this->year, '%Y-%m-%d'));
73 * Obtiene la fecha de fin del mes anterior.
78 function getEndOfPrevMonth()
80 return new MLIB_Date(Date_Calc::endOfPrevMonth(
81 $this->day, $this->month, $this->year, '%Y-%m-%d'));