diff options
author | xuri <xuri.me@gmail.com> | 2022-05-02 12:30:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 12:30:18 +0800 |
commit | eed431e0fc2f61b13e7745857a41cb47d9f7f810 (patch) | |
tree | 8244e1b4749d177313e51a3d73686d16c0176451 /stream.go | |
parent | 773d4afa32a55349a7b178c4c76d182f9ed0221f (diff) |
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
Diffstat (limited to 'stream.go')
-rw-r--r-- | stream.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |