planarnetwork/dtd2mysql

"00:00" parsed to public_departure_time parsed from CIF instead of NULL

Closed this issue · 0 comments

mk-fg commented

Seem to be an issue with fix for #16, as reverting 1ee1a61 fixes that.

Looks like this in CIF database:

  N26072  250761 N 2017-11-13 2017-11-13 1...... A YRK --:-- 00:35 TB
  N26072  250761 N 2017-11-13 2017-11-13 1...... A THI --:-- 00:00
  N26072  250761 N 2017-11-13 2017-11-13 1...... A NTR 01:06 00:00 D
  N26072  250761 N 2017-11-13 2017-11-13 1...... A DAR 01:20 00:00 D
  N26072  250761 N 2017-11-13 2017-11-13 1...... A DHM 01:38 00:00 D
  N26072  250761 N 2017-11-13 2017-11-13 1...... A NCL 02:08 --:-- TF

(where "--:--" are NULL values)

Instead of this (with 1ee1a61 reverted):

  N26072  250761 N 2017-11-13 2017-11-13 1...... A YRK --:-- 00:35 TB
  N26072  250761 N 2017-11-13 2017-11-13 1...... A THI --:-- --:--
  N26072  250761 N 2017-11-13 2017-11-13 1...... A NTR 01:06 --:-- D
  N26072  250761 N 2017-11-13 2017-11-13 1...... A DAR 01:20 --:-- D
  N26072  250761 N 2017-11-13 2017-11-13 1...... A DHM 01:38 --:-- D
  N26072  250761 N 2017-11-13 2017-11-13 1...... A NCL 02:08 --:-- TF

Seem to be due to using 5-char TimeField for all *_time fields, while it's only scheduled_*_time that have that optional "H" marker, not public_*_time ones.
Hence nullable/nullChars check on TimeField for public times failing when there's an extra random char being captured from the next sibling field.

Guess some special TimeFieldWithHalfMinute can be introduced for scheduled-time fields instead of extending TimeField everywhere.