code refactor
This commit is contained in:
@@ -3,8 +3,10 @@ package converters
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/mayswind/ezbookkeeping/pkg/errs"
|
||||
"github.com/mayswind/ezbookkeeping/pkg/utils"
|
||||
)
|
||||
|
||||
// ezBookKeepingTransactionPlainTextDataTable defines the structure of ezbookkeeping transaction plain text data table
|
||||
@@ -68,6 +70,16 @@ func (r *ezBookKeepingTransactionPlainTextDataRow) GetData(columnIndex int) stri
|
||||
return r.allItems[columnIndex]
|
||||
}
|
||||
|
||||
// GetTime returns the time in the specified column index
|
||||
func (r *ezBookKeepingTransactionPlainTextDataRow) GetTime(columnIndex int, timezoneOffset int16) (time.Time, error) {
|
||||
return utils.ParseFromLongDateTime(r.GetData(columnIndex), timezoneOffset)
|
||||
}
|
||||
|
||||
// GetTimezoneOffset returns the time zone offset in the specified column index
|
||||
func (r *ezBookKeepingTransactionPlainTextDataRow) GetTimezoneOffset(columnIndex int) (*time.Location, error) {
|
||||
return utils.ParseFromTimezoneOffset(r.GetData(columnIndex))
|
||||
}
|
||||
|
||||
// HasNext returns whether the iterator does not reach the end
|
||||
func (t *ezBookKeepingTransactionPlainTextDataRowIterator) HasNext() bool {
|
||||
return t.currentIndex+1 < len(t.dataTable.allLines)
|
||||
|
||||
Reference in New Issue
Block a user