diff --git a/excelext/mapper.go b/excelext/mapper.go index 88309ff..a250549 100644 --- a/excelext/mapper.go +++ b/excelext/mapper.go @@ -1,4 +1,4 @@ -package excelbuilder +package excelext import ( "reflect" @@ -78,7 +78,7 @@ func (em *ExcelMapper[T]) InitNewFile(sheetName string) (*excelize.File, error) func (em *ExcelMapper[T]) InitStyles(f *excelize.File) error { styleDate, err := f.NewStyle(&excelize.Style{ - CustomNumFmt: new("dd.mm.yyyy"), + CustomNumFmt: langext.Ptr("dd.mm.yyyy"), }) if err != nil { return err diff --git a/excelext/utils.go b/excelext/utils.go new file mode 100644 index 0000000..b82c1b1 --- /dev/null +++ b/excelext/utils.go @@ -0,0 +1,26 @@ +package excelext + +import ( + "strconv" + + "git.blackforestbytes.com/BlackForestBytes/goext/rfctime" + "github.com/360EntSecGroup-Skylar/excelize" +) + +func c(row int, col int) string { + return excelize.ToAlphaString(col) + strconv.Itoa(row) +} + +func excelizeOptTime(t *rfctime.RFC3339NanoTime) any { + if t == nil { + return "" + } + return t.Time() +} + +func excelizeOptDate(t *rfctime.Date) any { + if t == nil { + return "" + } + return t.TimeUTC() +} diff --git a/goextVersion.go b/goextVersion.go index 6b134a8..6d97a43 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.629" +const GoextVersion = "0.0.630" -const GoextVersionTimestamp = "2026-03-14T14:09:13+0100" +const GoextVersionTimestamp = "2026-03-14T14:10:09+0100"