@@ -64,6 +64,10 @@ |
||
64 | 64 | * |
65 | 65 | *\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ |
66 | 66 | */ |
67 | + |
|
68 | + /** |
|
69 | + * @param \DateTime $date_time |
|
70 | + */ |
|
67 | 71 | public function __construct( $date_time = null ) |
68 | 72 | { |
69 | 73 |
@@ -58,6 +58,10 @@ |
||
58 | 58 | * |
59 | 59 | *\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ |
60 | 60 | */ |
61 | + |
|
62 | + /** |
|
63 | + * @param string $path |
|
64 | + */ |
|
61 | 65 | private function fetch( $path ) |
62 | 66 | { |
63 | 67 |
@@ -124,17 +124,17 @@ |
||
124 | 124 | $this->date_time->setDate(Events::$date_start->format('Y'), $month, $day); |
125 | 125 | |
126 | 126 | switch ($this->local[ 'default_calendar' ]) { |
127 | - case 'jalali': |
|
128 | - $this->date_time->setDate(1394, $month, $day); |
|
127 | + case 'jalali': |
|
128 | + $this->date_time->setDate(1394, $month, $day); |
|
129 | 129 | |
130 | - $this->date_time = Datium::create($this->date_time)->from('jalali')->to('gregorian')->object(); //$this->convert->jalaliToGregorian( $this->date_time ); |
|
130 | + $this->date_time = Datium::create($this->date_time)->from('jalali')->to('gregorian')->object(); //$this->convert->jalaliToGregorian( $this->date_time ); |
|
131 | 131 | |
132 | - break; |
|
132 | + break; |
|
133 | 133 | |
134 | - case 'hijri': |
|
135 | - $this->date_time = Datium::create($this->date_time)->from('hijri')->to('gregorian')->object(); // $this->convert->hijriToGregorian( $this->date_time ); |
|
134 | + case 'hijri': |
|
135 | + $this->date_time = Datium::create($this->date_time)->from('hijri')->to('gregorian')->object(); // $this->convert->hijriToGregorian( $this->date_time ); |
|
136 | 136 | |
137 | - break; |
|
137 | + break; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $this->result[ $this->date_time->format('Y-m-d') ][] = $event; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * Get current datetime |
179 | 179 | * |
180 | 180 | * @since Aug 17 2015 |
181 | - * @return object |
|
181 | + * @return Datium |
|
182 | 182 | */ |
183 | 183 | public static function now() |
184 | 184 | { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @param integer $minute minute number |
200 | 200 | * @param integer $second second number |
201 | 201 | * |
202 | - * @return object |
|
202 | + * @return Datium |
|
203 | 203 | */ |
204 | 204 | public static function create( |
205 | 205 | $year = 2000, |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @param object $date_start Start of the DateTime |
242 | 242 | * @param object $date_end End of the DateTime |
243 | 243 | * |
244 | - * @return object |
|
244 | + * @return Datium |
|
245 | 245 | */ |
246 | 246 | public static function between($date_start, $date_end) |
247 | 247 | { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * |
288 | 288 | * @param object $calendar Assigned calendar to when calendar should start. |
289 | 289 | * |
290 | - * @return object |
|
290 | + * @return Datium |
|
291 | 291 | */ |
292 | 292 | public function to($calendar) |
293 | 293 | { |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | * |
329 | 329 | * @param string $value How much date should be added to current date |
330 | 330 | * |
331 | - * @return object |
|
331 | + * @return Datium |
|
332 | 332 | */ |
333 | 333 | public function add($value) |
334 | 334 | { |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | * |
359 | 359 | * @param string $value How much date should increase from current date |
360 | 360 | * |
361 | - * @return obejct |
|
361 | + * @return Datium |
|
362 | 362 | */ |
363 | 363 | public function sub($value) |
364 | 364 | { |
@@ -386,9 +386,8 @@ discard block |
||
386 | 386 | /** |
387 | 387 | * Check if current year is leap or not |
388 | 388 | * |
389 | - * @param string $type Name of the calendar to caculate leap year |
|
390 | 389 | * |
391 | - * @return boolean |
|
390 | + * @return Leap |
|
392 | 391 | */ |
393 | 392 | public function leap() |
394 | 393 | { |
@@ -404,7 +403,7 @@ discard block |
||
404 | 403 | * |
405 | 404 | * @since Aug, 22 2015 |
406 | 405 | * |
407 | - * @return integer |
|
406 | + * @return DayOf |
|
408 | 407 | */ |
409 | 408 | public function dayOf() |
410 | 409 | { |
@@ -451,7 +450,7 @@ discard block |
||
451 | 450 | * |
452 | 451 | * @param string $language language short name fa, en, ar ... |
453 | 452 | * |
454 | - * @return object |
|
453 | + * @return Datium |
|
455 | 454 | */ |
456 | 455 | public function lang($language = 'fa') |
457 | 456 | { |
@@ -471,7 +470,7 @@ discard block |
||
471 | 470 | /** |
472 | 471 | * Return object as timestamp |
473 | 472 | * |
474 | - * @return timestamp |
|
473 | + * @return integer |
|
475 | 474 | */ |
476 | 475 | public function timestamp() |
477 | 476 | { |
@@ -112,36 +112,36 @@ |
||
112 | 112 | $this->calendar_type = 'gregorian'; |
113 | 113 | |
114 | 114 | switch (Datium::$call_type) { |
115 | - case 'now': |
|
116 | - $this->date_time = new DateTime('now'); |
|
115 | + case 'now': |
|
116 | + $this->date_time = new DateTime('now'); |
|
117 | 117 | |
118 | - $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
118 | + $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
119 | 119 | |
120 | - break; |
|
120 | + break; |
|
121 | 121 | |
122 | - case 'make': |
|
123 | - $this->date_time = new DateTime('now'); |
|
122 | + case 'make': |
|
123 | + $this->date_time = new DateTime('now'); |
|
124 | 124 | |
125 | - $this->date_time->setDate( |
|
126 | - self::$array_date[ 'year' ], |
|
127 | - self::$array_date[ 'month' ], |
|
128 | - self::$array_date[ 'day' ] |
|
129 | - ); |
|
125 | + $this->date_time->setDate( |
|
126 | + self::$array_date[ 'year' ], |
|
127 | + self::$array_date[ 'month' ], |
|
128 | + self::$array_date[ 'day' ] |
|
129 | + ); |
|
130 | 130 | |
131 | - $this->date_time->setTime( |
|
132 | - self::$array_date[ 'hour' ], |
|
133 | - self::$array_date[ 'minute' ], |
|
134 | - self::$array_date[ 'second' ] |
|
135 | - ); |
|
131 | + $this->date_time->setTime( |
|
132 | + self::$array_date[ 'hour' ], |
|
133 | + self::$array_date[ 'minute' ], |
|
134 | + self::$array_date[ 'second' ] |
|
135 | + ); |
|
136 | 136 | |
137 | - $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
137 | + $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
138 | 138 | |
139 | - break; |
|
139 | + break; |
|
140 | 140 | |
141 | - case 'set': |
|
142 | - $this->date_time = Datium::$static_date_time; |
|
141 | + case 'set': |
|
142 | + $this->date_time = Datium::$static_date_time; |
|
143 | 143 | |
144 | - $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
144 | + $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | $this->convert_calendar = new Convert(); |