@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | /** Converts $val into a \DateTime object if it's not already */ |
17 | 17 | private function getDate($val) { |
18 | 18 | $tz = new \DateTimeZone($this->locale['timezone']); |
19 | - $date = $val instanceof \DateTimeInterface ? $val : new \DateTime($val, $tz); |
|
19 | + $date = $val instanceof \DateTimeInterface ? $val : new \DateTime($val, $tz); |
|
20 | 20 | $date->setTimeZone($tz); |
21 | 21 | return $date; |
22 | 22 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | /** Formats \DateTime as Date and Time using formats from $locale */ |
37 | 37 | public function dateTime($val) { |
38 | - return $this->date($val, $this->locale['date_format'] . ' ' . $this->locale['time_format']); |
|
38 | + return $this->date($val, $this->locale['date_format'].' '.$this->locale['time_format']); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** Generates relative time offsets based on system clock. e.g "10 minutes ago" or "In 6 months" |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $diff = $now->diff($date); |
48 | 48 | |
49 | 49 | |
50 | - $diffDays = $diff->invert === 1 ? $diff->days : 0- $diff->days; |
|
50 | + $diffDays = $diff->invert === 1 ? $diff->days : 0-$diff->days; |
|
51 | 51 | |
52 | 52 | if ($diffDays !== 0) return $this->dayOffset($diffDays); |
53 | 53 | else return $this->timeOffset($diff); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | /** Gets date ranges to represent uses of weeks/months/days/etc */ |
77 | 77 | private function getRanges($strings) { |
78 | - $ranges = [ |
|
78 | + $ranges = [ |
|
79 | 79 | [1, 1, $strings['yesterday'], 1, ''], |
80 | 80 | [1, 13, $strings['past'], 1, 'days'], |
81 | 81 | [13, 28, $strings['past'], 7, 'weeks'], |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | /** Converts "week" to "weeks", "month" to "months" etc when plural is required using language from $locale */ |
96 | 96 | private function getPlural($strings, $num, $interval) { |
97 | - if ($interval !== '') return $num == 1 ? $strings[$interval . '_singular'] : $strings[$interval . '_plural']; |
|
97 | + if ($interval !== '') return $num == 1 ? $strings[$interval.'_singular'] : $strings[$interval.'_plural']; |
|
98 | 98 | else return ''; |
99 | 99 | } |
100 | 100 |