Merge pull request #10920 from Godmartinz/Fixed_#10866_-_Checkin_time_always_shows_12am-master

Fixed #10866 - action_date for check-in not including H:i:s
This commit is contained in:
snipe 2022-04-07 19:39:59 +01:00 committed by GitHub
commit 6c1bb89776
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -105,9 +105,9 @@ class AssetCheckinController extends Controller
$asset->location_id = e($request->get('location_id'));
}
$checkin_at = date('Y-m-d');
if($request->filled('checkin_at')){
$checkin_at = $request->input('checkin_at');
$checkin_at = date('Y-m-d H:i:s');
if (($request->filled('checkin_at')) && ($request->get('checkin_at') != date('Y-m-d'))) {
$checkin_at = $request->get('checkin_at');
}
// Was the asset updated?

View file

@ -116,6 +116,9 @@ trait Loggable
$log->location_id = null;
$log->note = $note;
$log->action_date = $action_date;
if (! $log->action_date) {
$log->action_date = date('Y-m-d H:i:s');
}
if (Auth::user()) {
$log->user_id = Auth::user()->id;