export: tint day-off rows with theme totalFill background
This commit is contained in:
@@ -81,6 +81,16 @@ func GenerateMonthlyReport(store *db.Store, userID int64, timezone, accent, cale
|
|||||||
},
|
},
|
||||||
Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
|
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)
|
monthName := formatMonthTitle(calendar, calYear, calMonth)
|
||||||
f.SetCellValue(sheet, "A1", fmt.Sprintf("Work Time Report - %s", monthName))
|
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.SetCellValue(sheet, cellBreak, fmtHHMM(breakSec))
|
||||||
f.SetCellStyle(sheet, cellBreak, cellBreak, dataStyle)
|
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++
|
row++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user