Skip to content

Commit

Permalink
fix(swift): make valuta dates work
Browse files Browse the repository at this point in the history
  • Loading branch information
mitch000001 committed May 25, 2022
1 parent c7f8142 commit ed05ae4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions swift/mt940.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ func parseDate(value []byte, referenceYear int) (time.Time, error) {
if strings.HasSuffix(dateString, "0229") {
return time.Date(referenceYear, 2, 29, 0, 0, 0, 0, time.UTC), nil
}
if strings.HasSuffix(dateString, "0230") {
return time.Date(referenceYear, 2, 30, 0, 0, 0, 0, time.UTC), nil
}
return time.Time{}, err
}
return date.Truncate(24 * time.Hour), nil
Expand Down

0 comments on commit ed05ae4

Please sign in to comment.