serviceDate = ServiceDate.parseString(tripDescriptor.getStartDate()); } catch (final ParseException e) { LOG.warn("Failed to parse start date in gtfs-rt trip update: \n{}", tripUpdate);
ServiceDate date; try { date = ServiceDate.parseString(trip.getStartDate()); } catch (ParseException e) { return trip;
if (trip.hasStartDate() && ! "0".equals(trip.getStartDate())) { try { serviceDate = ServiceDate.parseString(trip.getStartDate()); } catch (ParseException ex) { _log.warn("Could not parse service date " + trip.getStartDate(), ex);
vpm.setTripStart(GtfsRealtimeConversionLibrary.parseDate(td.getStartDate(), td.getStartTime()));
tu.setTripStart(GtfsRealtimeConversionLibrary.parseDate(t.getStartDate(), t.getStartTime()));
esm.setTripStartDate(t.getStartDate());
/** * <code>optional string start_date = 3;</code> * * <pre> * The scheduled start date of this trip instance. * Must be provided to disambiguate trips that are so late as to collide with * a scheduled trip on a next day. For example, for a train that departs 8:00 * and 20:00 every day, and is 12 hours late, there would be two distinct * trips on the same time. * This field can be provided but is not mandatory for schedules in which such * collisions are impossible - for example, a service running on hourly * schedule where a vehicle that is one hour late is not considered to be * related to schedule anymore. * In YYYYMMDD format. * </pre> */ public Builder clearStartDate() { bitField0_ = (bitField0_ & ~0x00000010); startDate_ = getDefaultInstance().getStartDate(); onChanged(); return this; } /**
/** * Checks rule E021 - "Invalid start_date format", and adds any errors that are found to the provided error list * * @param entity The VehiclePosition or TripUpdate that contains the data to be evaluated for rule E021 * @param trip The TripDescriptor be evaluated for rule E021 * @param errors list to add any errors for E021 to */ private void checkE021(Object entity, GtfsRealtime.TripDescriptor trip, List<OccurrenceModel> errors) { if (trip.hasStartDate()) { if (!TimestampUtils.isValidDateFormat(trip.getStartDate())) { RuleUtils.addOccurrence(E021, GtfsUtils.getVehicleAndTripIdText(entity) + " start_date is " + trip.getStartDate(), errors, _log); } } }
/** * <code>optional string start_date = 3;</code> * * <pre> * The scheduled start date of this trip instance. * Must be provided to disambiguate trips that are so late as to collide with * a scheduled trip on a next day. For example, for a train that departs 8:00 * and 20:00 every day, and is 12 hours late, there would be two distinct * trips on the same time. * This field can be provided but is not mandatory for schedules in which such * collisions are impossible - for example, a service running on hourly * schedule where a vehicle that is one hour late is not considered to be * related to schedule anymore. * In YYYYMMDD format. * </pre> */ public Builder clearStartDate() { bitField0_ = (bitField0_ & ~0x00000010); startDate_ = getDefaultInstance().getStartDate(); onChanged(); return this; } /**