summaryrefslogtreecommitdiff
path: root/cell.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-02-13 00:06:30 +0800
committerxuri <xuri.me@gmail.com>2022-02-13 00:06:30 +0800
commit4b64b26c52932a51ca97a2bb6bf372a07020e52b (patch)
tree0d5b88ab9db7b459de73e65b022871ef69fe2cd6 /cell.go
parent3f8f4f52e68d408da5a2e5108af3cc99bf8586bc (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.go11
1 files changed, 1 insertions, 10 deletions
diff --git a/cell.go b/cell.go
index 9af93f6..b5b6ed4 100644
--- a/cell.go
+++ b/cell.go
@@ -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 {