summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--date.go7
-rw-r--r--date_test.go2
-rw-r--r--excelize_test.go2
-rw-r--r--stream_test.go2
4 files changed, 3 insertions, 10 deletions
diff --git a/date.go b/date.go
index 9ef5caf..0531b6c 100644
--- a/date.go
+++ b/date.go
@@ -30,13 +30,6 @@ var (
func timeToExcelTime(t time.Time) (float64, error) {
// TODO in future this should probably also handle date1904 and like TimeFromExcelTime
- // Force user to explicit convet passed value to UTC time.
- // Because for example 1900-01-01 00:00:00 +0300 MSK converts to 1900-01-01 00:00:00 +0230 LMT
- // probably due to daylight saving.
- if t.Location() != time.UTC {
- return 0.0, ErrToExcelTime
- }
-
if t.Before(excelMinTime1900) {
return 0.0, nil
}
diff --git a/date_test.go b/date_test.go
index ecc96ba..38898b0 100644
--- a/date_test.go
+++ b/date_test.go
@@ -55,7 +55,7 @@ func TestTimeToExcelTime_Timezone(t *testing.T) {
for i, test := range trueExpectedDateList {
t.Run(fmt.Sprintf("TestData%d", i+1), func(t *testing.T) {
_, err := timeToExcelTime(test.GoValue.In(location))
- assert.EqualError(t, err, ErrToExcelTime.Error())
+ assert.NoError(t, err)
})
}
}
diff --git a/excelize_test.go b/excelize_test.go
index 0c42178..ba7b528 100644
--- a/excelize_test.go
+++ b/excelize_test.go
@@ -144,7 +144,7 @@ func TestOpenFile(t *testing.T) {
assert.NoError(t, f.SetCellValue("Sheet2", "G2", nil))
- assert.EqualError(t, f.SetCellValue("Sheet2", "G4", time.Now()), ErrToExcelTime.Error())
+ assert.NoError(t, f.SetCellValue("Sheet2", "G4", time.Now()))
assert.NoError(t, f.SetCellValue("Sheet2", "G4", time.Now().UTC()))
// 02:46:40
diff --git a/stream_test.go b/stream_test.go
index 391c99d..cf133f1 100644
--- a/stream_test.go
+++ b/stream_test.go
@@ -57,7 +57,7 @@ func TestStreamWriter(t *testing.T) {
assert.NoError(t, err)
assert.NoError(t, streamWriter.SetRow("A4", []interface{}{Cell{StyleID: styleID}, Cell{Formula: "SUM(A10,B10)"}}))
assert.NoError(t, streamWriter.SetRow("A5", []interface{}{&Cell{StyleID: styleID, Value: "cell"}, &Cell{Formula: "SUM(A10,B10)"}}))
- assert.EqualError(t, streamWriter.SetRow("A6", []interface{}{time.Now()}), ErrToExcelTime.Error())
+ assert.NoError(t, streamWriter.SetRow("A6", []interface{}{time.Now()}))
for rowID := 10; rowID <= 51200; rowID++ {
row := make([]interface{}, 50)