diff options
author | xuri <xuri.me@gmail.com> | 2022-02-13 00:06:30 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-02-13 00:06:30 +0800 |
commit | 4b64b26c52932a51ca97a2bb6bf372a07020e52b (patch) | |
tree | 0d5b88ab9db7b459de73e65b022871ef69fe2cd6 /cell.go | |
parent | 3f8f4f52e68d408da5a2e5108af3cc99bf8586bc (diff) |
Ref: #660, #764, #1093, #1112, #1133 This improve number format support
- Introduced NFP (number format parser) dependencies module
- Initialize custom dates and times number format support
- Dependencies module upgraded
Diffstat (limited to 'cell.go')
-rw-r--r-- | cell.go | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -1116,21 +1116,12 @@ func (f *File) formattedValue(s int, v string, raw bool) string { } for _, xlsxFmt := range styleSheet.NumFmts.NumFmt { if xlsxFmt.NumFmtID == numFmtID { - format := strings.ToLower(xlsxFmt.FormatCode) - if isTimeNumFmt(format) { - return parseTime(v, format) - } - return precise + return format(v, xlsxFmt.FormatCode) } } return precise } -// isTimeNumFmt determine if the given number format expression is a time number format. -func isTimeNumFmt(format string) bool { - return strings.Contains(format, "y") || strings.Contains(format, "m") || strings.Contains(strings.Replace(format, "red", "", -1), "d") || strings.Contains(format, "h") -} - // prepareCellStyle provides a function to prepare style index of cell in // worksheet by given column index and style index. func (f *File) prepareCellStyle(ws *xlsxWorksheet, col, row, style int) int { |