aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pkg/datamaps/db.go4
-rw-r--r--pkg/datamaps/testdata/test_template.xlsmbin9194 -> 9390 bytes
-rw-r--r--pkg/datamaps/testdata/test_template.xlsxbin9397 -> 9389 bytes
-rw-r--r--pkg/datamaps/writer_test.go7
4 files changed, 8 insertions, 3 deletions
diff --git a/pkg/datamaps/db.go b/pkg/datamaps/db.go
index d95bfd7..2a63a11 100644
--- a/pkg/datamaps/db.go
+++ b/pkg/datamaps/db.go
@@ -243,6 +243,10 @@ func importXLSXtoDB(dmName string, returnName string, file string, db *sql.DB) e
}
defer insertStmt.Close()
+ // Hack to fix bug in Libreoffice numformats for dates
+ if cellData.NumFmt == "DD/MM/YY" {
+ cellData.SetFormat("dd/mm/yy")
+ }
fValue, err := cellData.FormattedValue()
if err != nil {
return err
diff --git a/pkg/datamaps/testdata/test_template.xlsm b/pkg/datamaps/testdata/test_template.xlsm
index 725805d..7681c04 100644
--- a/pkg/datamaps/testdata/test_template.xlsm
+++ b/pkg/datamaps/testdata/test_template.xlsm
Binary files differ
diff --git a/pkg/datamaps/testdata/test_template.xlsx b/pkg/datamaps/testdata/test_template.xlsx
index 52f6360..4b46dbb 100644
--- a/pkg/datamaps/testdata/test_template.xlsx
+++ b/pkg/datamaps/testdata/test_template.xlsx
Binary files differ
diff --git a/pkg/datamaps/writer_test.go b/pkg/datamaps/writer_test.go
index e16ce10..e168f8d 100644
--- a/pkg/datamaps/writer_test.go
+++ b/pkg/datamaps/writer_test.go
@@ -4,6 +4,7 @@ import (
"fmt"
"os"
"os/exec"
+ "path/filepath"
"strings"
"testing"
@@ -38,9 +39,9 @@ func TestWriteMaster(t *testing.T) {
XLSXPath: "./testdata/",
}
- // defer func() {
- // os.Remove(filepath.Join(opts.MasterOutPutPath, "master.xlsx"))
- // }()
+ defer func() {
+ os.Remove(filepath.Join(opts.MasterOutPutPath, "master.xlsx"))
+ }()
if err := DatamapToDB(&opts); err != nil {
t.Fatalf("Unable to write datamap to database file because %v.", err)