Negative Werte werden deutlich dargestellt.

This commit is contained in:
2021-04-15 12:23:22 +02:00
parent 2b2753e009
commit cc9941d1d3
3 changed files with 17 additions and 1 deletions
+9 -1
View File
@@ -1,6 +1,14 @@
<script>
export let 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>
<svelte:head>
@@ -36,7 +44,7 @@
<td>{record.period}</td>
<td>{record.workingDays}</td>
<td>{record.totalHours}</td>
<td>{record.overtime}</td>
<td class="{ isNegative(record.overtime) }">{cutMinusChar(record.overtime)}</td>
</tr>
{/each}
</tbody>