removed Formatduration and fixed rounding error, working on overtime calculation

This commit is contained in:
2025-07-20 19:34:16 +02:00
parent 68000a0f0a
commit 4201ed7b1c
8 changed files with 230 additions and 179 deletions

View File

@@ -1,6 +1,7 @@
package templates
import (
"arbeitszeitmessung/helper"
"arbeitszeitmessung/models"
"fmt"
"net/url"
@@ -39,6 +40,8 @@ templ inputForm() {
templ dayComponent(workDay models.WorkDay) {
{{
work, pause := workDay.GetWorkTimeString()
user := ctx.Value("user").(models.User)
overtime := helper.FormatDuration(workDay.CalcOvertime(user))
justify := ""
if len(workDay.Bookings) <= 1 {
justify = "justify-content: center"
@@ -57,6 +60,7 @@ templ dayComponent(workDay models.WorkDay) {
<p class=" text-accent">{ work }</p>
}
<p class="text-neutral-500">{ pause }</p>
<p class="text-neutral-500">{ overtime }</p>
}
</div>
</div>