Datepicker from CDN on TourEdit Page
This commit is contained in:
parent
cb07013fde
commit
af73b49cfa
4 changed files with 64 additions and 6 deletions
|
|
@ -88,8 +88,8 @@ class TourController extends Controller
|
|||
$tour->name=$request->input('name');
|
||||
$tour->user_id=$request->input('user_id');
|
||||
$tour->beschreibung=$request->input('beschreibung');
|
||||
$tour->start=$request->input('start');
|
||||
$tour->deadline=$request->input('deadline');
|
||||
$tour->start=Tour::toDBDate($request->input('start'));
|
||||
$tour->deadline=Tour::toDBDate($request->input('deadline'));
|
||||
$tour->max_participants=$request->input('max_participants');
|
||||
$tour->is_cancelled=$request->input('is_cancelled',false);
|
||||
$tour->save();
|
||||
|
|
@ -115,12 +115,16 @@ class TourController extends Controller
|
|||
array_push($users, $user);
|
||||
}
|
||||
if($tour->start<Carbon::now()) {
|
||||
$tour->start = Tour::toGermanDate($tour->start);
|
||||
$tour->deadline = Tour::toGermanDate($tour->deadline);
|
||||
return view('tour.show_old')
|
||||
->with('tour', $tour)
|
||||
->with('users', $users)
|
||||
->with('creator', $creator);
|
||||
}
|
||||
|
||||
$tour->start = Tour::toGermanDate($tour->start);
|
||||
$tour->deadline = Tour::toGermanDate($tour->deadline);
|
||||
return view('tour.show')
|
||||
->with('tour', $tour)
|
||||
->with('users', $users)
|
||||
|
|
@ -139,6 +143,10 @@ class TourController extends Controller
|
|||
if ($tour->start<Carbon::now()) {
|
||||
return view('tour.edit_old')->with('tour', $tour);
|
||||
}
|
||||
|
||||
$tour->start = Tour::toGermanDate($tour->start);
|
||||
$tour->deadline = Tour::toGermanDate($tour->deadline);
|
||||
|
||||
return view('tour.edit')->with('tour', $tour);
|
||||
}
|
||||
|
||||
|
|
@ -187,8 +195,8 @@ class TourController extends Controller
|
|||
|
||||
$tour->name=$request->input('name');
|
||||
if ($request->beschreibung) $tour->beschreibung=$request->input('beschreibung');
|
||||
if ($request->start) $tour->start=$request->input('start');
|
||||
if ($request->deadline) $tour->deadline=$request->input('deadline');
|
||||
if ($request->start) $tour->start=Tour::toDBDate($request->input('start'));
|
||||
if ($request->deadline) $tour->deadline=Tour::toDBDate($request->input('deadline'));
|
||||
if ($request->max_participants) $tour->max_participants=$request->input('max_participants');
|
||||
$tour->is_cancelled= ($request->has('is_cancelled'));
|
||||
if ($request->bericht) $tour->bericht=$request->bericht;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue