function __construct($year_or_date = null, $month = null) { if ($year_or_date && $month) { $tmp_date = new lmbDateTime($year_or_date, $month, 1); } elseif ($year_or_date && !$month) { $tmp_date = new lmbDateTime($year_or_date); } else { $tmp_date = new lmbDateTime(); } $this->start_date = $tmp_date->getBeginOfMonth(); $this->end_date = $tmp_date->getEndOfMonth(); }
function testGetEndOfMonth() { $date = new lmbDateTime('2007-05-09 12:24:12'); $this->assertEqual($date->getEndOfMonth(), new lmbDateTime('2007-05-31 23:59:59')); }