From eed431e0fc2f61b13e7745857a41cb47d9f7f810 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 2 May 2022 12:30:18 +0800 Subject: This closes #1219, fixes cell value reading issue, improves performance, and 1904 date system support - Fix incorrect cell data types casting results when number formatting - Support set cell value on 1904 date system enabled, ref #1212 - Improve performance for set sheet row and the merging cells, fix performance impact when resolving #1129 --- stream.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'stream.go') diff --git a/stream.go b/stream.go index c2eda68..e1a12be 100644 --- a/stream.go +++ b/stream.go @@ -440,7 +440,11 @@ func (sw *StreamWriter) setCellValFunc(c *xlsxC, val interface{}) (err error) { c.T, c.V = setCellDuration(val) case time.Time: var isNum bool - c.T, c.V, isNum, err = setCellTime(val) + date1904, wb := false, sw.File.workbookReader() + if wb != nil && wb.WorkbookPr != nil { + date1904 = wb.WorkbookPr.Date1904 + } + c.T, c.V, isNum, err = setCellTime(val, date1904) if isNum && c.S == 0 { style, _ := sw.File.NewStyle(&Style{NumFmt: 22}) c.S = style -- cgit v1.2.1