Hello, i cant seem to figure out how to calculate hours for a specific person. Does anyone have any ideas or tips on how should i tackle this problem?
procedure TForm1.FormCreate(Sender: TObject);
const
mask = 'mm/dd/yyyy"," hh:nn:ss AM/PM';
lekcijas = 7;
var
Lines, list: TStringList;
s: string;
i: integer;
d, atnaca, aizgaja: TDateTime;
fs: TformatSettings;
begin
Lines := TStringList.Create;
Lines.Loadfromfile('apm.csv');
list := TStringList.Create;
setLength(Fails, Lines.Count);
list.delimiter := ';';
list.strictdelimiter := True;
for i := 1 to High(Fails) do
begin
list.DelimitedText := Lines[i];
with Fails[i] do
begin
Vards := list[0];
if pos('(', Vards) > 0 then
Vards := leftstr(Vards, pos('(', Vards) - 2);
if (combobox1.items.indexof(Vards) < 0) then
combobox1.items.add(Vards);
Darbiba := not (list[1] = 'Left');
s := list[2];
fs := DefaultFormatSettings;
fs.DateSeparator := '/';
laiks := ScanDateTime(mask, s, fs);
end;
end;
I have managed to get the time read in the memory correctly and that works all fine, but now i need to figure out how would i calculate total hours for a person
https://gyazo.com/48797ac202108236a0cd012fd1e178e1 The file that is read in looks like this and it has joined/left for every person in each day that the meeting took place. Any advice would be appriciated.