arr and dep with composite regex

This commit is contained in:
zhiqiang feng
2021-01-05 12:43:04 +08:00
parent 263f38633f
commit 67a28c2280
4 changed files with 113 additions and 58 deletions
+7 -1
View File
@@ -98,8 +98,14 @@ func parseFlight(s string) (flightNumber string, registerNumber string) {
return s, ""
}
func getAirportAndTime(s string) (airport string, arrivalTime time.Time) {
func parseAirportAndTime(s string) (airport string, arrivalTime time.Time) {
fields := getFields(DestinationRegex, s)
arrivalTime, _ = time.Parse("1504", fields["time"])
return fields["dest"], arrivalTime
}
func parseDof(text string) time.Time {
value := getFields(DofValueRex, text)
dof, _ := time.Parse("060102", value["time"])
return dof
}