@@ 34-46 (lines=13) @@ | ||
31 | return $this->weeks; |
|
32 | } |
|
33 | ||
34 | public function prev(){ |
|
35 | $year = $this->year; |
|
36 | $month = $this->month; |
|
37 | ||
38 | if($month == 1){ |
|
39 | $month = 12; |
|
40 | $year--; |
|
41 | } else { |
|
42 | $month--; |
|
43 | } |
|
44 | ||
45 | return ["year" => $year, "month"=>$month]; |
|
46 | } |
|
47 | public function next(){ |
|
48 | $year = $this->year; |
|
49 | $month = $this->month; |
|
@@ 47-57 (lines=11) @@ | ||
44 | ||
45 | return ["year" => $year, "month"=>$month]; |
|
46 | } |
|
47 | public function next(){ |
|
48 | $year = $this->year; |
|
49 | $month = $this->month; |
|
50 | if($month == 12){ |
|
51 | $month = 1; |
|
52 | $year++; |
|
53 | } else { |
|
54 | $month++; |
|
55 | } |
|
56 | return ["year" => $year, "month"=>$month]; |
|
57 | } |
|
58 | public function addWeek($week) |
|
59 | { |
|
60 | $this->weeks[] = $week; |