Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private MSpec doCall() {
&& (lastDeparture < -1 || lastDeparture < lastFrequency.getEndTime())) {
lastDeparture = lastFrequency.getEndTime();
}
DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone(mAgenciesList.get(0).getTimezone()));
DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone(mAgenciesList.get(0).getTimezoneId()));
try {
firstTimestamp = GFieldTypes.toTimeStamp(DATE_TIME_FORMAT, firstCalendarDate, firstDeparture);
} catch (Exception e) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/mtransit/parser/mt/MGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ private static void dumpCommonValues(File dumpDirF, GAgencyTools gAgencyTools, M
ow.write(getRESOURCES_INTEGER(GTFS_RDS_AGENCY_EXTENDED_TYPE, gAgencyTools.getAgencyExtendedRouteType()));
ow.write(Constants.NEW_LINE);
}
ow.write(getRESOURCES_STRING(GTFS_RDS_TIMEZONE, mSpec.getFirstAgency().getTimezone()));
ow.write(getRESOURCES_STRING(GTFS_RDS_TIMEZONE, mSpec.getFirstAgency().getTimezoneId()));
ow.write(Constants.NEW_LINE);
ow.write(getRESOURCES_STRING(GTFS_RDS_COLOR, mSpec.getFirstAgency().getColor()));
ow.write(Constants.NEW_LINE);
Expand Down Expand Up @@ -1193,7 +1193,7 @@ private static void dumpValues(File dumpDirF, String fileBase, MSpec mSpec, Doub
ow.write(getRESOURCES_BOOL(fileBase + GTFS_RDS_FREQUENCY_AVAILABLE, mSpec.hasRouteFrequencies()));
ow.write(Constants.NEW_LINE);
if (StringUtils.isEmpty(fileBase)) {
ow.write(getRESOURCES_STRING(GTFS_RDS_TIMEZONE, mSpec.getFirstAgency().getTimezone()));
ow.write(getRESOURCES_STRING(GTFS_RDS_TIMEZONE, mSpec.getFirstAgency().getTimezoneId()));
ow.write(Constants.NEW_LINE);
}
ow.write(getRESOURCES_STRING(fileBase + GTFS_RDS_AREA_MIN_LAT, minLat));
Expand Down Expand Up @@ -1226,9 +1226,9 @@ private static String getCommentedDateTime(int timestampInSec, @NotNull MSpec mS
try {
final DateFormat dateTimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss z", Locale.ENGLISH);
try {
dateTimeFormat.setTimeZone(TimeZone.getTimeZone(mSpec.getFirstAgency().getTimezone()));
dateTimeFormat.setTimeZone(TimeZone.getTimeZone(mSpec.getFirstAgency().getTimezoneId()));
} catch (Exception e) {
MTLog.logNonFatal(e, "Error while setting time-zone for commented date time %s!", mSpec.getFirstAgency().getTimezone());
MTLog.logNonFatal(e, "Error while setting time-zone for commented date time %s!", mSpec.getFirstAgency().getTimezoneId());
}
Comment thread
mmathieum marked this conversation as resolved.
final String formattedTime = dateTimeFormat.format(new Date(TimeUnit.SECONDS.toMillis(timestampInSec)));
return "<!-- " + formattedTime + " -->";
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/mtransit/parser/mt/data/MAgency.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data class MAgency(
val idInt: Int,
val name: String,
val url: String,
val timezone: String,
val timezoneId: String,
val color: String,
val type: Int,
) : Comparable<MAgency?> {
Expand Down Expand Up @@ -49,7 +49,7 @@ data class MAgency(
this.idInt != other.idInt -> this._id.compareTo(other._id)
this.name != other.name -> this.name.compareTo(other.name)
this.url != other.url -> this.url.compareTo(other.url)
this.timezone != other.timezone -> this.timezone.compareTo(other.timezone)
this.timezoneId != other.timezoneId -> this.timezoneId.compareTo(other.timezoneId)
this.color != other.color -> this.color.compareTo(other.color)
this.type != other.type -> this.type.compareTo(other.type)
else -> 0
Expand Down