This commit is contained in:
Liu Ming
2017-02-21 16:27:01 +08:00
parent 1127e94c69
commit f02a04cbdd
6 changed files with 68 additions and 32 deletions

6
col.go
View File

@@ -4,7 +4,6 @@ import (
"fmt"
"math"
"strconv"
"strings"
"time"
)
@@ -50,13 +49,14 @@ func (xf *XfRk) String(wb *WorkBook) string {
if len(wb.Xfs) > idx {
fNo := wb.Xfs[idx].formatNo()
if fNo >= 164 { // user defined format
if fmt := wb.Formats[fNo]; fmt != nil && strings.Contains(fmt.str, "YY") {
if fmt := wb.Formats[fNo]; fmt != nil {
i, f, isFloat := xf.Rk.number()
if !isFloat {
f = float64(i)
}
t := timeFromExcelTime(f, wb.dateMode == 1)
return t.Format(time.RFC3339) //TODO it should be international
return t.Format(time.RFC3339) //TODO it should be international and format as the describled style
}
// see http://www.openoffice.org/sc/excelfileformat.pdf
} else if 14 <= fNo && fNo <= 17 || fNo == 22 || 27 <= fNo && fNo <= 36 || 50 <= fNo && fNo <= 58 { // jp. date format