Skip to content

Commit

Permalink
fixed financial start
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Dec 31, 2018
1 parent c3720fc commit bc9fbfb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/Http/Controllers/Wizard/Companies.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Http\Requests\Wizard\Company as Request;
use App\Models\Common\Company;
use App\Traits\Uploads;
use Date;

class Companies extends Controller
{
Expand Down Expand Up @@ -70,6 +71,11 @@ public function update(Request $request)
}
}

// Format financial year
if ($key == 'financial_start') {
$value = Date::parse($value)->format('d-m');
}

setting()->set('general.' . $key, $value);
}

Expand Down
2 changes: 1 addition & 1 deletion database/seeds/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private function create()
$company_id = $this->command->argument('company');

Setting::set([
'general.financial_start' => Date::now()->startOfYear()->format('d F'),
'general.financial_start' => Date::now()->startOfYear()->format('d-m'),
'general.timezone' => 'Europe/London',
'general.date_format' => 'd M Y',
'general.date_separator' => 'space',
Expand Down

0 comments on commit bc9fbfb

Please sign in to comment.