Skip to content

Commit

Permalink
calendar MDL-24378 set better defaults when constructing a calendar o…
Browse files Browse the repository at this point in the history
…bject.
  • Loading branch information
Sam Hemelryk committed Sep 28, 2010
1 parent 25c55fe commit d8d8bdd
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2428,7 +2428,22 @@ class calendar_information {
* @param int $month
* @param int $year
*/
public function __construct($day, $month, $year) {
public function __construct($day=0, $month=0, $year=0) {

$date = usergetdate(time());

if (empty($day)) {
$day = $date['mday'];
}

if (empty($month)) {
$month = $date['mon'];
}

if (empty($year)) {
$year = $date['year'];
}

$this->day = $day;
$this->month = $month;
$this->year = $year;
Expand Down

0 comments on commit d8d8bdd

Please sign in to comment.