Updating localstorage

So I’m trying to make an app that allows visitors to sign in and out. Ive been able to store the names and the date and time they sign in in local storage but when it comes to updating the time they leave, I need some help

This is how i store the info in localstorage

$scope.task = {
‘id’: id,
‘fname’: ‘’,
‘lname’: ‘’,
‘resident’: ‘’,
‘date’: date,
‘dateout’: ‘?’

I have got some code that updates the ‘dateout’:

var dateout = new Date();
var signout = JSON.parse(localStorage[“allVisitors”]);
for(var i=0;i<signout.length;i++)
if (signout[i].id == ‘signout[i].id’) signout[i].dateout = dateout;
localStorage[“allVisitors”] = JSON.stringify(signout);

but how do display the names that are currently signed in (display in a modal window) and update the ‘dateout’ when someone clicks on a name?