export: tint day-off rows with theme totalFill background

This commit is contained in:
2026-06-24 19:23:16 +03:30
parent 4edff71bfd
commit 8d919decb0

View File

@@ -81,6 +81,16 @@ func GenerateMonthlyReport(store *db.Store, userID int64, timezone, accent, cale
},
Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
})
dayOffStyle, _ := f.NewStyle(&excelize.Style{
Fill: excelize.Fill{Type: "pattern", Pattern: 1, Color: []string{theme.totalFill}},
Border: []excelize.Border{
{Type: "left", Color: theme.border, Style: 1},
{Type: "right", Color: theme.border, Style: 1},
{Type: "top", Color: theme.border, Style: 1},
{Type: "bottom", Color: theme.border, Style: 1},
},
Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
})
monthName := formatMonthTitle(calendar, calYear, calMonth)
f.SetCellValue(sheet, "A1", fmt.Sprintf("Work Time Report - %s", monthName))
@@ -192,6 +202,12 @@ func GenerateMonthlyReport(store *db.Store, userID int64, timezone, accent, cale
f.SetCellValue(sheet, cellBreak, fmtHHMM(breakSec))
f.SetCellStyle(sheet, cellBreak, cellBreak, dataStyle)
if hasDayOff {
cellA, _ := excelize.CoordinatesToCellName(1, row)
cellF, _ := excelize.CoordinatesToCellName(6, row)
f.SetCellStyle(sheet, cellA, cellF, dayOffStyle)
}
row++
}