diff options
Diffstat (limited to 'pkg/adapters/xlsx/model.go')
| -rw-r--r-- | pkg/adapters/xlsx/model.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/adapters/xlsx/model.go b/pkg/adapters/xlsx/model.go index 79434f0..ff92def 100644 --- a/pkg/adapters/xlsx/model.go +++ b/pkg/adapters/xlsx/model.go @@ -23,11 +23,11 @@ type Ticket struct { ToCountry string ToAirport string ToCoords model.LatLong - FlightDate string // (raw, expected YYYY-MM-DD; Excel text may start with ') - FlightTime string // (raw, expected HH-MM or HH:MM; Excel text may start with ') + FlightDate string // expected YYYY-MM-DD + FlightTime string // expected HH-MM or HH:MM PNR string Card string - TicketNumber string // (may have a leading ' in Excel) + TicketNumber string } func (t Ticket) DateTime() (time.Time, *time.Location, error) { @@ -62,13 +62,13 @@ func iataToLocation(code string) *time.Location { if err != nil { return nil } - // Prefer IANA tz name + // prefer IATA tz name if tz := strings.TrimSpace(ap.Tz); tz != "" && tz != `\N` { if loc, err := time.LoadLocation(tz); err == nil { return loc } } - // Fallback: fixed offset (no DST) + // fallback to fixed offset (no DST) if ap.Timezone != 0 { sec := int(ap.Timezone * 3600.0) return time.FixedZone("UTC"+offsetLabel(sec), sec) @@ -91,4 +91,4 @@ func two(x int) string { return "0" + strconv.Itoa(x) } return strconv.Itoa(x) -}
\ No newline at end of file +} |
