| Total Complexity | 8 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class DateHelpers |
||
| 8 | { |
||
| 9 | |||
| 10 | public function convertDate($date) |
||
| 11 | { |
||
| 12 | return date('Y-m-d',strtotime($date)); |
||
| 13 | } |
||
| 14 | |||
| 15 | public function convertToDayName($date) |
||
| 16 | { |
||
| 17 | $time = strtotime($date); |
||
| 18 | $day = date('l', $time); |
||
| 19 | |||
| 20 | return $day; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function greaterThanDate($neddle, $haystack) |
||
| 24 | { |
||
| 25 | $b =[]; |
||
| 26 | foreach ($haystack as $k => $v) { |
||
| 27 | if(strtotime($k) > strtotime($neddle)){ |
||
| 28 | $b[] = (object) ['date' => $k, 'description' => $v]; |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | return $b; |
||
| 33 | |||
| 34 | } |
||
| 35 | |||
| 36 | public function lessThanDate($neddle, $haystack) |
||
| 46 | |||
| 47 | } |
||
| 48 | |||
| 49 | } |
||
| 50 |