Skip to content

Commit

Permalink
Merge pull request #199 from entur/add-default-timezone-for-system
Browse files Browse the repository at this point in the history
Add default timezone for system
  • Loading branch information
testower authored Aug 4, 2023
2 parents 8e0f34b + 48549b2 commit fba9043
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public class SystemInformationFeedMapper
@Value("${org.entur.lamassu.targetGbfsVersion:2.2}")
private String targetGbfsVersion;

@Value("${org.entur.lamassu.defaultTimeZone:Europe/Oslo}")
private String defaultTimeZone;

@Override
public GBFSSystemInformation map(
GBFSSystemInformation source,
Expand Down Expand Up @@ -74,7 +77,11 @@ private GBFSData mapData(GBFSData source, FeedProvider feedProvider) {
mapped.setPhoneNumber(source.getPhoneNumber());
mapped.setEmail(source.getEmail());
mapped.setFeedContactEmail(source.getFeedContactEmail());
mapped.setTimezone(source.getTimezone());
mapped.setTimezone(
source.getTimezone() != null
? source.getTimezone()
: GBFSData.Timezone.fromValue(defaultTimeZone)
);
mapped.setLicenseUrl(source.getLicenseUrl());
mapped.setBrandAssets(source.getBrandAssets());
mapped.setTermsUrl(source.getTermsUrl());
Expand Down

0 comments on commit fba9043

Please sign in to comment.