Skip to content

Commit

Permalink
fix: Trailing 오류가 발생하지 않아야 합니다.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laeng committed Jul 20, 2024
1 parent 97f5a41 commit ae61758
Show file tree
Hide file tree
Showing 2 changed files with 1,249 additions and 1,130 deletions.
7 changes: 6 additions & 1 deletion app/Http/Controllers/App/Mission/EditorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ public function create(Request $request, SurveyServiceContract $surveyService, N
}

$typeKorean = MissionType::getKoreanNames()[$type];
$date = \Carbon\Carbon::createFromFormat('Y-m-d H:i', "{$request->get('date')} {$request->get('time')}");
try {
$date = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', "{$request->get('date')} {$request->get('time')}");
} catch (\Exception $e) {
throw new \Exception('Invalid data/time format', 422);
}


if ($date->isPast())
{
Expand Down
Loading

0 comments on commit ae61758

Please sign in to comment.