Skip to content

Commit

Permalink
radelt: sue string timestamps and fix station names
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Jul 17, 2024
1 parent 7a5f0ac commit 5313145
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public class RadeltChallengeDto {
private String name;
private String shortName;
private String headerImage;
private long start;
private long end;
private long registrationStart;
private long entryStart;
private long registrationEnd;
private long entryEnd;
private String start;
private String end;
private String registrationStart;
private String entryStart;
private String registrationEnd;
private String entryEnd;
private String type;
@JsonProperty("isExternal")
private boolean isExternal;
Expand Down Expand Up @@ -62,100 +62,52 @@ public void setHeaderImage(String headerImage) {
this.headerImage = headerImage;
}

public long getStart() {
public String getStart() {
return start;
}

public void setStart(String start) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
// Parse the date string to a Date object
Date date = sdf.parse(start);
this.start = date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
}

public long getEntryStart() {
this.start = start;
}

public String getEntryStart() {
return entryStart;
}

public void setEntryStart(String entryStart) {
try{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
// Parse the date string to a Date object
Date date = sdf.parse(entryStart);
this.entryStart = date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
this.entryStart = entryStart;
}

public long getEnd() {
public String getEnd() {
return end;
}

public void setEnd(String end) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
// Parse the date string to a Date object
Date date = sdf.parse(end);
this.end = date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
}

public long getEntryEnd() {
this.end = end;
}

public String getEntryEnd() {
return entryEnd;
}

public void setEntryEnd(String entryEnd) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
// Parse the date string to a Date object
Date date = sdf.parse(entryEnd);
this.registrationStart = date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
this.registrationStart = registrationStart;
}

public long getRegistrationStart() {
public String getRegistrationStart() {
return registrationStart;
}

public void setRegistrationStart(String registrationStart) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
// Parse the date string to a Date object
Date date = sdf.parse(registrationStart);
this.registrationStart = date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
}

public long getRegistrationEnd() {
this.registrationStart = registrationStart;
}

public String getRegistrationEnd() {
return registrationEnd;
}

public void setRegistrationEnd(String registrationEnd) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
// Parse the date string to a Date object
Date date = sdf.parse(registrationEnd);
this.registrationEnd = date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
this.registrationEnd = registrationEnd;
}

public String getType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private StationDto mapToStationDto(RadeltOrganisationenDto organisation,
if (challengeStatistics.getChallenge_id() != null) {
stationDto.setId(String.valueOf(challengeStatistics.getId()) + "-"
+ String.valueOf(challengeStatistics.getChallenge_id()));
stationDto.setName(challengeStatistics.getName() + '-' + challengeStatistics.getChallenge_name());
stationDto.setName(organisation.getName() + '-' + challengeStatistics.getChallenge_name());
stationDto.setStationType(DATA_TYPE);

// METADATA
Expand Down

0 comments on commit 5313145

Please sign in to comment.