12 |
12 |
13 { |
13 { |
14 daystring = substr($3, 2); |
14 daystring = substr($3, 2); |
15 work = $2; |
15 work = $2; |
16 |
16 |
17 if (work == fora) |
17 if (work == fora || substr(work,1,5) == "fora,") |
18 { |
18 { |
|
19 if (work == "fora,malalt") |
|
20 accumtime = 8*3600 |
|
21 |
19 hores = int(accumtime / 3600); |
22 hores = int(accumtime / 3600); |
20 minuts = int((accumtime - hores*3600) / 60); |
23 minuts = int((accumtime - hores*3600) / 60); |
21 segons = int(accumtime - hores*3600 - minuts*60); |
24 segons = int(accumtime - hores*3600 - minuts*60); |
22 |
25 |
23 plegant = substr($4, 1, length($4)-1); |
26 plegant = substr($4, 1, length($4)-1); |
24 printf "%s: %02i:%02i:%02i (plegant a les %s)\n", |
27 |
25 daystring, hores, minuts, segons, plegant; |
28 split(daystring, diaplegar, "-"); |
|
29 split(plegant, horaplegar, ":"); |
|
30 |
|
31 stamp = mktime(diaplegar[1] " " diaplegar[2] " " diaplegar[3] " " horaplegar[1] \ |
|
32 " " horaplegar[2] " " horaplegar[3] " CEST"); |
|
33 |
|
34 diasetmana = strftime("%A", stamp) |
|
35 |
|
36 printf "%-10s %s: %02i:%02i:%02i (plegant a les %s)\n", |
|
37 diasetmana, daystring, hores, minuts, segons, plegant; |
|
38 |
|
39 accumsetmana += accumtime; |
|
40 if (diasetmana == "divendres") |
|
41 { |
|
42 hores = int(accumsetmana / 3600); |
|
43 minuts = int((accumsetmana - hores*3600) / 60); |
|
44 segons = int(accumsetmana - hores*3600 - minuts*60); |
|
45 printf "- Total setmana: %02i:%02i:%02i\n", |
|
46 hores, minuts, segons |
|
47 |
|
48 accumsetmana = 0; |
|
49 } |
|
50 |
|
51 |
26 accumtime = 0; |
52 accumtime = 0; |
27 } |
53 } |
28 else |
54 else |
29 { |
55 { |
30 if (work != ignora) |
56 if (work != ignora) |