diff options
Diffstat (limited to 'includes/view/User_view.php')
-rw-r--r-- | includes/view/User_view.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/includes/view/User_view.php b/includes/view/User_view.php index c2bf4a06..4768f4ac 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -320,6 +320,23 @@ function User_shift_state_render($user) . '</span>'; } +function User_last_shift_render($user) +{ + if (!$user->state->arrived) { + return ''; + } + + $last_shifts = ShiftEntries_finished_by_user($user->id); + if (empty($last_shifts)) { + return ''; + } + + $lastShift = array_shift($last_shifts); + return '<span class="moment-countdown" data-timestamp="' . $lastShift['end'] . '">' + . __('Shift ended %c') + . '</span>'; +} + /** * @param array $needed_angel_type * @return string |