Fix date layout in README and full example
This commit is contained in:
1 parent
a5ece792f8
commit
5f7829feee
3 files changed
+12
-12
No files matched your search
@@ -99,7 +99,7 @@ type DateTime struct {
|
||||
|
||||
// Convert the internal date as CSV string
|
||||
func (date *DateTime) MarshalCSV() (string, error) {
|
||||
return date.Time.Format("20060201"), nil
|
||||
return date.Time.Format("20060102"), nil
|
||||
}
|
||||
|
||||
// You could also use the standard Stringer interface
|
||||
@@ -109,7 +109,7 @@ func (date *DateTime) String() (string) {
|
||||
|
||||
// Convert the CSV string as internal date
|
||||
func (date *DateTime) UnmarshalCSV(csv string) (err error) {
|
||||
date.Time, err = time.Parse("20060201", csv)
|
||||
date.Time, err = time.Parse("20060102", csv)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user