@@ -34,17 +34,17 @@ discard block |
||
34 | 34 | { |
35 | 35 | |
36 | 36 | /** |
37 | - * Store DateTime object |
|
38 | - */ |
|
37 | + * Store DateTime object |
|
38 | + */ |
|
39 | 39 | protected $date_time; |
40 | 40 | |
41 | 41 | protected static $static_date_time; |
42 | 42 | |
43 | 43 | /** |
44 | - * Store config file statements |
|
45 | - * |
|
46 | - * @param array |
|
47 | - */ |
|
44 | + * Store config file statements |
|
45 | + * |
|
46 | + * @param array |
|
47 | + */ |
|
48 | 48 | protected $config; |
49 | 49 | |
50 | 50 | protected $date_interval_expression; |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | protected $fromConfig; |
63 | 63 | |
64 | 64 | /** |
65 | - * Return store day number |
|
66 | - * |
|
67 | - * @param integer |
|
68 | - */ |
|
65 | + * Return store day number |
|
66 | + * |
|
67 | + * @param integer |
|
68 | + */ |
|
69 | 69 | protected $day_of; |
70 | 70 | |
71 | 71 | protected $leap; |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | protected static $timestamp; |
94 | 94 | |
95 | 95 | /** |
96 | - * Timeago |
|
97 | - * |
|
98 | - * @param integer |
|
99 | - */ |
|
96 | + * Timeago |
|
97 | + * |
|
98 | + * @param integer |
|
99 | + */ |
|
100 | 100 | protected $ago; |
101 | 101 | |
102 | 102 | /** |
103 | - * Datium class constructure |
|
104 | - */ |
|
103 | + * Datium class constructure |
|
104 | + */ |
|
105 | 105 | public function __construct() |
106 | 106 | { |
107 | 107 | |
@@ -167,10 +167,10 @@ discard block |
||
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
170 | - * Return all datetime parts as an object |
|
171 | - * |
|
172 | - * @return object |
|
173 | - */ |
|
170 | + * Return all datetime parts as an object |
|
171 | + * |
|
172 | + * @return object |
|
173 | + */ |
|
174 | 174 | public function all() |
175 | 175 | { |
176 | 176 | |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
196 | - * Get current datetime |
|
197 | - * |
|
198 | - * @since Aug 17 2015 |
|
199 | - * @return object |
|
200 | - */ |
|
196 | + * Get current datetime |
|
197 | + * |
|
198 | + * @since Aug 17 2015 |
|
199 | + * @return object |
|
200 | + */ |
|
201 | 201 | public static function now() |
202 | 202 | { |
203 | 203 | |
@@ -208,17 +208,17 @@ discard block |
||
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
211 | - * Create new date time |
|
212 | - * |
|
213 | - * @param integer $year Year number |
|
214 | - * @param integer $month month number |
|
215 | - * @param integer $day day number |
|
216 | - * @param integer $hour hour number |
|
217 | - * @param integer $minute minute number |
|
218 | - * @param integer $second second number |
|
219 | - * |
|
220 | - * @return object |
|
221 | - */ |
|
211 | + * Create new date time |
|
212 | + * |
|
213 | + * @param integer $year Year number |
|
214 | + * @param integer $month month number |
|
215 | + * @param integer $day day number |
|
216 | + * @param integer $hour hour number |
|
217 | + * @param integer $minute minute number |
|
218 | + * @param integer $second second number |
|
219 | + * |
|
220 | + * @return object |
|
221 | + */ |
|
222 | 222 | public static function create( |
223 | 223 | $year = 2000, |
224 | 224 | $month = 1, |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | |
231 | 231 | |
232 | 232 | /** |
233 | - * When we want to set a Datetime object to Datium |
|
234 | - */ |
|
233 | + * When we want to set a Datetime object to Datium |
|
234 | + */ |
|
235 | 235 | if (func_num_args() === 1) { |
236 | 236 | self::$static_date_time = func_get_arg(0); |
237 | 237 | |
@@ -254,11 +254,11 @@ discard block |
||
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
257 | - * Accecpt Timestamp as Datium initializion |
|
258 | - * |
|
259 | - * @param timestamp $timestamp Input timestamp value |
|
260 | - * @return object |
|
261 | - */ |
|
257 | + * Accecpt Timestamp as Datium initializion |
|
258 | + * |
|
259 | + * @param timestamp $timestamp Input timestamp value |
|
260 | + * @return object |
|
261 | + */ |
|
262 | 262 | public static function createTimestamp( $timestamp ) |
263 | 263 | { |
264 | 264 | |
@@ -281,13 +281,13 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
284 | - * Select The range between two date object |
|
285 | - * |
|
286 | - * @param object $date_start Start of the DateTime |
|
287 | - * @param object $date_end End of the DateTime |
|
288 | - * |
|
289 | - * @return object |
|
290 | - */ |
|
284 | + * Select The range between two date object |
|
285 | + * |
|
286 | + * @param object $date_start Start of the DateTime |
|
287 | + * @param object $date_end End of the DateTime |
|
288 | + * |
|
289 | + * @return object |
|
290 | + */ |
|
291 | 291 | public static function between($date_start, $date_end) |
292 | 292 | { |
293 | 293 | |
@@ -302,12 +302,12 @@ discard block |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
305 | - * Convert from current calendar, what type is current calendar? |
|
306 | - * |
|
307 | - * @param object $calendar Assigned calendar to start from |
|
308 | - * |
|
309 | - * @return $object |
|
310 | - */ |
|
305 | + * Convert from current calendar, what type is current calendar? |
|
306 | + * |
|
307 | + * @param object $calendar Assigned calendar to start from |
|
308 | + * |
|
309 | + * @return $object |
|
310 | + */ |
|
311 | 311 | public function from($calendar) |
312 | 312 | { |
313 | 313 | |
@@ -317,8 +317,8 @@ discard block |
||
317 | 317 | |
318 | 318 | |
319 | 319 | /** |
320 | - * We need this part for DayOf class |
|
321 | - */ |
|
320 | + * We need this part for DayOf class |
|
321 | + */ |
|
322 | 322 | $this->calendar_type = $calendar; |
323 | 323 | |
324 | 324 | $this->translate_to = $calendar; |
@@ -328,12 +328,12 @@ discard block |
||
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
331 | - * Convert date to current Date |
|
332 | - * |
|
333 | - * @param object $calendar Assigned calendar to when calendar should start. |
|
334 | - * |
|
335 | - * @return object |
|
336 | - */ |
|
331 | + * Convert date to current Date |
|
332 | + * |
|
333 | + * @param object $calendar Assigned calendar to when calendar should start. |
|
334 | + * |
|
335 | + * @return object |
|
336 | + */ |
|
337 | 337 | public function to($calendar) |
338 | 338 | { |
339 | 339 | |
@@ -342,8 +342,8 @@ discard block |
||
342 | 342 | $this->date_time = $this->convert->to($calendar); |
343 | 343 | |
344 | 344 | /** |
345 | - * We need this part for DayOf class |
|
346 | - */ |
|
345 | + * We need this part for DayOf class |
|
346 | + */ |
|
347 | 347 | $this->calendar_type = $calendar; |
348 | 348 | |
349 | 349 | $this->translate_to = $calendar; |
@@ -353,13 +353,13 @@ discard block |
||
353 | 353 | } |
354 | 354 | |
355 | 355 | /** |
356 | - * Difference between two time |
|
357 | - * |
|
358 | - * @param DateTime $start Start of the date |
|
359 | - * @param DateTime $end End of the date |
|
360 | - * |
|
361 | - * @return object |
|
362 | - */ |
|
356 | + * Difference between two time |
|
357 | + * |
|
358 | + * @param DateTime $start Start of the date |
|
359 | + * @param DateTime $end End of the date |
|
360 | + * |
|
361 | + * @return object |
|
362 | + */ |
|
363 | 363 | public static function diff($start, $end) |
364 | 364 | { |
365 | 365 | |
@@ -382,12 +382,12 @@ discard block |
||
382 | 382 | } |
383 | 383 | |
384 | 384 | /** |
385 | - * Add new date value to current date |
|
386 | - * |
|
387 | - * @param string $value How much date should be added to current date |
|
388 | - * |
|
389 | - * @return object |
|
390 | - */ |
|
385 | + * Add new date value to current date |
|
386 | + * |
|
387 | + * @param string $value How much date should be added to current date |
|
388 | + * |
|
389 | + * @return object |
|
390 | + */ |
|
391 | 391 | public function add($value) |
392 | 392 | { |
393 | 393 | |
@@ -424,12 +424,12 @@ discard block |
||
424 | 424 | } |
425 | 425 | |
426 | 426 | /** |
427 | - * Sub date from current date |
|
428 | - * |
|
429 | - * @param string $value How much date should increase from current date |
|
430 | - * |
|
431 | - * @return obejct |
|
432 | - */ |
|
427 | + * Sub date from current date |
|
428 | + * |
|
429 | + * @param string $value How much date should increase from current date |
|
430 | + * |
|
431 | + * @return obejct |
|
432 | + */ |
|
433 | 433 | public function sub($value) |
434 | 434 | { |
435 | 435 | |
@@ -466,12 +466,12 @@ discard block |
||
466 | 466 | } |
467 | 467 | |
468 | 468 | /** |
469 | - * Check if current year is leap or not |
|
470 | - * |
|
471 | - * @param string $type Name of the calendar to caculate leap year |
|
472 | - * |
|
473 | - * @return boolean |
|
474 | - */ |
|
469 | + * Check if current year is leap or not |
|
470 | + * |
|
471 | + * @param string $type Name of the calendar to caculate leap year |
|
472 | + * |
|
473 | + * @return boolean |
|
474 | + */ |
|
475 | 475 | public function leap() |
476 | 476 | { |
477 | 477 | |
@@ -482,10 +482,10 @@ discard block |
||
482 | 482 | } |
483 | 483 | |
484 | 484 | /** |
485 | - * Calculate how many time ago datetime happens |
|
486 | - * |
|
487 | - * @return string |
|
488 | - */ |
|
485 | + * Calculate how many time ago datetime happens |
|
486 | + * |
|
487 | + * @return string |
|
488 | + */ |
|
489 | 489 | public function ago() |
490 | 490 | { |
491 | 491 | |
@@ -496,12 +496,12 @@ discard block |
||
496 | 496 | } |
497 | 497 | |
498 | 498 | /** |
499 | - * Caculate day of year or week |
|
500 | - * |
|
501 | - * @since Aug, 22 2015 |
|
502 | - * |
|
503 | - * @return integer |
|
504 | - */ |
|
499 | + * Caculate day of year or week |
|
500 | + * |
|
501 | + * @since Aug, 22 2015 |
|
502 | + * |
|
503 | + * @return integer |
|
504 | + */ |
|
505 | 505 | public function dayOf() |
506 | 506 | { |
507 | 507 | |
@@ -529,12 +529,12 @@ discard block |
||
529 | 529 | // } |
530 | 530 | |
531 | 531 | /** |
532 | - * Return Datetime as a original object |
|
533 | - * |
|
534 | - * @since Oct 22, 2015 |
|
535 | - * |
|
536 | - * @return object |
|
537 | - */ |
|
532 | + * Return Datetime as a original object |
|
533 | + * |
|
534 | + * @since Oct 22, 2015 |
|
535 | + * |
|
536 | + * @return object |
|
537 | + */ |
|
538 | 538 | public function object() |
539 | 539 | { |
540 | 540 | |
@@ -543,12 +543,12 @@ discard block |
||
543 | 543 | } |
544 | 544 | |
545 | 545 | /** |
546 | - * Translate current date string to selected language |
|
547 | - * |
|
548 | - * @param string $language language short name fa, en, ar ... |
|
549 | - * |
|
550 | - * @return object |
|
551 | - */ |
|
546 | + * Translate current date string to selected language |
|
547 | + * |
|
548 | + * @param string $language language short name fa, en, ar ... |
|
549 | + * |
|
550 | + * @return object |
|
551 | + */ |
|
552 | 552 | public function lang($language = 'fa') |
553 | 553 | { |
554 | 554 | |
@@ -565,10 +565,10 @@ discard block |
||
565 | 565 | } |
566 | 566 | |
567 | 567 | /** |
568 | - * Return object as timestamp |
|
569 | - * |
|
570 | - * @return timestamp |
|
571 | - */ |
|
568 | + * Return object as timestamp |
|
569 | + * |
|
570 | + * @return timestamp |
|
571 | + */ |
|
572 | 572 | public function timestamp() |
573 | 573 | { |
574 | 574 | |
@@ -577,14 +577,14 @@ discard block |
||
577 | 577 | } |
578 | 578 | |
579 | 579 | /** |
580 | - * Return fainal result |
|
581 | - * |
|
582 | - * @param string $format Date format |
|
583 | - * |
|
584 | - * @since Aug 17 2015 |
|
585 | - * |
|
586 | - * @return string |
|
587 | - */ |
|
580 | + * Return fainal result |
|
581 | + * |
|
582 | + * @param string $format Date format |
|
583 | + * |
|
584 | + * @since Aug 17 2015 |
|
585 | + * |
|
586 | + * @return string |
|
587 | + */ |
|
588 | 588 | public function get($format = 'Y-m-d H:i:s') |
589 | 589 | { |
590 | 590 | |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | |
601 | 601 | if (is_null($this->toConfig)) { |
602 | 602 | $this->toConfig = include 'CalendarSettings/' . |
603 | - ucfirst($this->translate_to) . '.php'; |
|
603 | + ucfirst($this->translate_to) . '.php'; |
|
604 | 604 | } |
605 | 605 | |
606 | 606 | $string_date = $this->date_time->format($format); |