From ded279a489631651943b5b65cdb3acb6764cf288 Mon Sep 17 00:00:00 2001 From: leshe4ka46 Date: Tue, 28 Oct 2025 13:42:55 +0300 Subject: unmarshal all formats, merge them in the single table, users are truly unique --- pkg/adapters/xlsx/model.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pkg/adapters/xlsx/model.go') 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 +} -- cgit v1.2.3