@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public function register() |
| 14 | 14 | { |
| 15 | 15 | // Register the main class to use with the facade |
| 16 | - $this->app->singleton('nepalidate', function () { |
|
| 16 | + $this->app->singleton('nepalidate', function() { |
|
| 17 | 17 | return new NepaliDate; |
| 18 | 18 | }); |
| 19 | 19 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | use Carbon\Carbon; |
| 4 | 4 | use Pratiksh\Nepalidate\Services\NepaliDate; |
| 5 | 5 | |
| 6 | -if (! function_exists('nepaliDate')) { |
|
| 6 | +if (!function_exists('nepaliDate')) { |
|
| 7 | 7 | function nepaliDate(Carbon $date) |
| 8 | 8 | { |
| 9 | 9 | $mode = config('nepalidate.mode', 1); |
@@ -19,33 +19,33 @@ discard block |
||
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -if (! function_exists('toBS')) { |
|
| 22 | +if (!function_exists('toBS')) { |
|
| 23 | 23 | function toBS(Carbon $date) |
| 24 | 24 | { |
| 25 | 25 | return (new NepaliDate())->create($date)->toBS(); |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -if (! function_exists('toFormattedBSDate')) { |
|
| 29 | +if (!function_exists('toFormattedBSDate')) { |
|
| 30 | 30 | function toFormattedBSDate(Carbon $date) |
| 31 | 31 | { |
| 32 | 32 | return (new NepaliDate())->create($date)->toFormattedBSDate(); |
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -if (! function_exists('toFormattedNepaliDate')) { |
|
| 36 | +if (!function_exists('toFormattedNepaliDate')) { |
|
| 37 | 37 | function toFormattedNepaliDate(Carbon $date) |
| 38 | 38 | { |
| 39 | 39 | return (new NepaliDate())->create($date)->toFormattedNepaliDate(); |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -if (! function_exists('toDetailBS')) { |
|
| 43 | +if (!function_exists('toDetailBS')) { |
|
| 44 | 44 | function toDetailBS(Carbon $date) |
| 45 | 45 | { |
| 46 | 46 | $bs_array = (new NepaliDate())->create($date)->toBSArray(); |
| 47 | 47 | $to_detail_bs = null; |
| 48 | - if (! is_null($bs_array)) { |
|
| 48 | + if (!is_null($bs_array)) { |
|
| 49 | 49 | if (is_array($bs_array)) { |
| 50 | 50 | if (count($bs_array) > 0) { |
| 51 | 51 | $to_detail_bs = json_decode(json_encode($bs_array)); |
@@ -190,24 +190,24 @@ |
||
| 190 | 190 | |
| 191 | 191 | public function toBS() |
| 192 | 192 | { |
| 193 | - return $this->nepaliYear . '-' . sprintf('%02d', $this->nepaliMonth) . '-' . sprintf('%02d', $this->nepaliDay); |
|
| 193 | + return $this->nepaliYear.'-'.sprintf('%02d', $this->nepaliMonth).'-'.sprintf('%02d', $this->nepaliDay); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | public function toFormattedBSDate() |
| 197 | 197 | { |
| 198 | - return $this->nepaliDay . ' ' . |
|
| 199 | - $this->formattedBSMonth($this->nepaliMonth) . ' ' . |
|
| 200 | - $this->nepaliYear . ',' . |
|
| 201 | - ' ' . |
|
| 198 | + return $this->nepaliDay.' '. |
|
| 199 | + $this->formattedBSMonth($this->nepaliMonth).' '. |
|
| 200 | + $this->nepaliYear.','. |
|
| 201 | + ' '. |
|
| 202 | 202 | $this->formattedBSDateOfWeek($this->dayOfWeek); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | public function toFormattedNepaliDate() |
| 206 | 206 | { |
| 207 | - return $this->formattedNepaliNumber($this->nepaliDay) . ' ' . |
|
| 208 | - $this->formattedNepaliMonth($this->nepaliMonth) . ' ' . |
|
| 209 | - $this->formattedNepaliNumber($this->nepaliYear) . ',' . |
|
| 210 | - ' ' . |
|
| 207 | + return $this->formattedNepaliNumber($this->nepaliDay).' '. |
|
| 208 | + $this->formattedNepaliMonth($this->nepaliMonth).' '. |
|
| 209 | + $this->formattedNepaliNumber($this->nepaliYear).','. |
|
| 210 | + ' '. |
|
| 211 | 211 | $this->formattedNepaliDateOfWeek($this->dayOfWeek); |
| 212 | 212 | } |
| 213 | 213 | |