mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
Merge pull request #506 from cachethq/fix-schedule-tz
Fixes scheduled incidents timezones
This commit is contained in:
commit
a84722de21
@ -4,13 +4,16 @@ namespace CachetHQ\Cachet\Http\Controllers;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
use Carbon\Carbon;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Jenssegers\Date\Date;
|
||||
|
||||
class DashScheduleController extends Controller
|
||||
{
|
||||
@ -84,7 +87,8 @@ class DashScheduleController extends Controller
|
||||
$scheduleData = Binput::get('incident');
|
||||
$scheduleData['user_id'] = Auth::user()->id;
|
||||
// Parse the schedule date.
|
||||
$scheduledAt = Carbon::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at']);
|
||||
$scheduledAt = Date::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at'], Setting::get('app_timezone'))
|
||||
->setTimezone(Config::get('app.timezone'));
|
||||
|
||||
if ($scheduledAt->isPast()) {
|
||||
$messageBag = new MessageBag();
|
||||
@ -159,7 +163,8 @@ class DashScheduleController extends Controller
|
||||
$scheduleData = Binput::get('incident');
|
||||
$scheduleData['user_id'] = Auth::user()->id;
|
||||
// Parse the schedule date.
|
||||
$scheduledAt = Carbon::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at']);
|
||||
$scheduledAt = Date::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at'], Setting::get('app_timezone'))
|
||||
->setTimezone(Config::get('app.timezone'));
|
||||
|
||||
if ($scheduledAt->isPast()) {
|
||||
$messageBag = new MessageBag();
|
||||
|
Loading…
x
Reference in New Issue
Block a user