diff --git a/internal/bot/export.go b/internal/bot/export.go index c2b018e..6e7652d 100644 --- a/internal/bot/export.go +++ b/internal/bot/export.go @@ -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++ }