@@ -100,7 +100,7 @@ |
||
| 100 | 100 | /** |
| 101 | 101 | * check the ghamari year is leap or not |
| 102 | 102 | * @since Oct, 24 2015 |
| 103 | - * @return boolean |
|
| 103 | + * @return integer|null |
|
| 104 | 104 | */ |
| 105 | 105 | public function ghamariLeapYear() { |
| 106 | 106 | |
@@ -132,23 +132,23 @@ |
||
| 132 | 132 | |
| 133 | 133 | switch ( $this->type ) { |
| 134 | 134 | |
| 135 | - case 'gregorian': |
|
| 135 | + case 'gregorian': |
|
| 136 | 136 | |
| 137 | - $this->result = $this->gregorinLeapYear(); |
|
| 137 | + $this->result = $this->gregorinLeapYear(); |
|
| 138 | 138 | |
| 139 | - break; |
|
| 139 | + break; |
|
| 140 | 140 | |
| 141 | - case 'jalali': |
|
| 141 | + case 'jalali': |
|
| 142 | 142 | |
| 143 | - $this->result = $this->jalaliLeapYear(); |
|
| 143 | + $this->result = $this->jalaliLeapYear(); |
|
| 144 | 144 | |
| 145 | - break; |
|
| 145 | + break; |
|
| 146 | 146 | |
| 147 | - case 'hijri': |
|
| 147 | + case 'hijri': |
|
| 148 | 148 | |
| 149 | - $this->result = $this->hijriLeapYear(); |
|
| 149 | + $this->result = $this->hijriLeapYear(); |
|
| 150 | 150 | |
| 151 | - break; |
|
| 151 | + break; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | return $this->result; |
@@ -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 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * Get current datetime |
| 184 | 184 | * |
| 185 | 185 | * @since Aug 17 2015 |
| 186 | - * @return object |
|
| 186 | + * @return Datium |
|
| 187 | 187 | */ |
| 188 | 188 | public static function now() |
| 189 | 189 | { |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * @param integer $minute minute number |
| 205 | 205 | * @param integer $second second number |
| 206 | 206 | * |
| 207 | - * @return object |
|
| 207 | + * @return Datium |
|
| 208 | 208 | */ |
| 209 | 209 | public static function create( $year = 2000, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0 ) |
| 210 | 210 | { |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | * @param object $date_start Start of the DateTime |
| 244 | 244 | * @param object $date_end End of the DateTime |
| 245 | 245 | * |
| 246 | - * @return object |
|
| 246 | + * @return Datium |
|
| 247 | 247 | */ |
| 248 | 248 | public static function between( $date_start, $date_end ) |
| 249 | 249 | { |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | * |
| 290 | 290 | * @param object $calendar Assigned calendar to when calendar should start. |
| 291 | 291 | * |
| 292 | - * @return object |
|
| 292 | + * @return Datium |
|
| 293 | 293 | */ |
| 294 | 294 | public function to( $calendar ) |
| 295 | 295 | { |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | * |
| 331 | 331 | * @param string $value How much date should be added to current date |
| 332 | 332 | * |
| 333 | - * @return object |
|
| 333 | + * @return Datium |
|
| 334 | 334 | */ |
| 335 | 335 | public function add( $value ) |
| 336 | 336 | { |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | * |
| 361 | 361 | * @param string $value How much date should increase from current date |
| 362 | 362 | * |
| 363 | - * @return obejct |
|
| 363 | + * @return Datium |
|
| 364 | 364 | */ |
| 365 | 365 | public function sub( $value ) |
| 366 | 366 | { |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | * |
| 391 | 391 | * @param string $type Name of the calendar to caculate leap year |
| 392 | 392 | * |
| 393 | - * @return boolean |
|
| 393 | + * @return Leap |
|
| 394 | 394 | */ |
| 395 | 395 | public function leap( $type = 'gregorian' ) |
| 396 | 396 | { |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | * |
| 407 | 407 | * @since Aug, 22 2015 |
| 408 | 408 | * |
| 409 | - * @return integer |
|
| 409 | + * @return DayOf |
|
| 410 | 410 | */ |
| 411 | 411 | public function dayOf() |
| 412 | 412 | { |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | * |
| 454 | 454 | * @param string $language language short name fa, en, ar ... |
| 455 | 455 | * |
| 456 | - * @return object |
|
| 456 | + * @return Datium |
|
| 457 | 457 | */ |
| 458 | 458 | public function lang( $language = 'fa' ) |
| 459 | 459 | { |
@@ -113,39 +113,39 @@ |
||
| 113 | 113 | |
| 114 | 114 | switch( Datium::$call_type ) { |
| 115 | 115 | |
| 116 | - case 'now': |
|
| 116 | + case 'now': |
|
| 117 | 117 | |
| 118 | - $this->date_time = new DateTime('now'); |
|
| 118 | + $this->date_time = new DateTime('now'); |
|
| 119 | 119 | |
| 120 | - $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 120 | + $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 121 | 121 | |
| 122 | - break; |
|
| 122 | + break; |
|
| 123 | 123 | |
| 124 | - case 'make': |
|
| 124 | + case 'make': |
|
| 125 | 125 | |
| 126 | - $this->date_time = new DateTime('now'); |
|
| 126 | + $this->date_time = new DateTime('now'); |
|
| 127 | 127 | |
| 128 | - $this->date_time->setDate( |
|
| 129 | - self::$array_date[ 'year' ], |
|
| 130 | - self::$array_date[ 'month' ], |
|
| 131 | - self::$array_date[ 'day' ] |
|
| 132 | - ); |
|
| 128 | + $this->date_time->setDate( |
|
| 129 | + self::$array_date[ 'year' ], |
|
| 130 | + self::$array_date[ 'month' ], |
|
| 131 | + self::$array_date[ 'day' ] |
|
| 132 | + ); |
|
| 133 | 133 | |
| 134 | - $this->date_time->setTime( |
|
| 135 | - self::$array_date[ 'hour' ], |
|
| 136 | - self::$array_date[ 'minute' ], |
|
| 137 | - self::$array_date[ 'second' ] |
|
| 138 | - ); |
|
| 134 | + $this->date_time->setTime( |
|
| 135 | + self::$array_date[ 'hour' ], |
|
| 136 | + self::$array_date[ 'minute' ], |
|
| 137 | + self::$array_date[ 'second' ] |
|
| 138 | + ); |
|
| 139 | 139 | |
| 140 | - $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 140 | + $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 141 | 141 | |
| 142 | - break; |
|
| 142 | + break; |
|
| 143 | 143 | |
| 144 | - case 'set': |
|
| 144 | + case 'set': |
|
| 145 | 145 | |
| 146 | - $this->date_time = Datium::$static_date_time; |
|
| 146 | + $this->date_time = Datium::$static_date_time; |
|
| 147 | 147 | |
| 148 | - $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 148 | + $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 149 | 149 | |
| 150 | 150 | } |
| 151 | 151 | |
@@ -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 | |
@@ -143,19 +143,19 @@ |
||
| 143 | 143 | |
| 144 | 144 | switch ( $this->local[ 'default_calendar' ] ) { |
| 145 | 145 | |
| 146 | - case 'jalali': |
|
| 146 | + case 'jalali': |
|
| 147 | 147 | |
| 148 | - $this->date_time->setDate(1394, $month, $day); |
|
| 148 | + $this->date_time->setDate(1394, $month, $day); |
|
| 149 | 149 | |
| 150 | - $this->date_time = Datium::create($this->date_time)->from('jalali')->to('gregorian')->object(); //$this->convert->jalaliToGregorian( $this->date_time ); |
|
| 150 | + $this->date_time = Datium::create($this->date_time)->from('jalali')->to('gregorian')->object(); //$this->convert->jalaliToGregorian( $this->date_time ); |
|
| 151 | 151 | |
| 152 | - break; |
|
| 152 | + break; |
|
| 153 | 153 | |
| 154 | - case 'hijri': |
|
| 154 | + case 'hijri': |
|
| 155 | 155 | |
| 156 | - $this->date_time = Datium::create($this->date_time)->from('hijri')->to('gregorian')->object(); // $this->convert->hijriToGregorian( $this->date_time ); |
|
| 156 | + $this->date_time = Datium::create($this->date_time)->from('hijri')->to('gregorian')->object(); // $this->convert->hijriToGregorian( $this->date_time ); |
|
| 157 | 157 | |
| 158 | - break; |
|
| 158 | + break; |
|
| 159 | 159 | |
| 160 | 160 | } |
| 161 | 161 | |