womtfix/negative-werte #12

Merged
TorstenHettstedt merged 4 commits from womtfix/negative-werte into master 2021-04-15 12:25:33 +02:00
3 changed files with 17 additions and 1 deletions
Showing only changes of commit cc9941d1d3 - Show all commits
+1
View File
@@ -6,6 +6,7 @@ Definition der Farben
@hueSub: 215; @hueSub: 215;
@mainColor: hsl(@hueMain, 90%, 29%); @mainColor: hsl(@hueMain, 90%, 29%);
@redColor: hsl(0, 90%, 29%);
@mainColorDark: darken(@mainColor,66%,relativ); @mainColorDark: darken(@mainColor,66%,relativ);
@mainColorLight: lighten(@mainColor,66%,relativ); @mainColorLight: lighten(@mainColor,66%,relativ);
@subColor: hsl(@hueSub, 90%, 29%); @subColor: hsl(@hueSub, 90%, 29%);
+7
View File
@@ -79,6 +79,13 @@ main {
border-bottom: @mainColor solid thin; border-bottom: @mainColor solid thin;
} }
} }
};
tbody {
td.absence-time {
color: @redColor;
text-decoration-line: underline;
text-decoration-style: dashed;
}
} }
} }
form { form {
+9 -1
View File
@@ -1,6 +1,14 @@
<script> <script>
export let params; export let params;
console.log(params) console.log(params)
if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
position = position || 0;
return this.indexOf(searchString, position) === position;
};
}
$: isNegative = time => time.startsWith('-') ? 'absence-time' : '';
$: cutMinusChar = time => time.startsWith('-') ? time.substr(1) : time;
</script> </script>
<svelte:head> <svelte:head>
@@ -36,7 +44,7 @@
<td>{record.period}</td> <td>{record.period}</td>
<td>{record.workingDays}</td> <td>{record.workingDays}</td>
<td>{record.totalHours}</td> <td>{record.totalHours}</td>
<td>{record.overtime}</td> <td class="{ isNegative(record.overtime) }">{cutMinusChar(record.overtime)}</td>
</tr> </tr>
{/each} {/each}
</tbody> </tbody>