Skip to content

Commit d887c3a

Browse files
Make formatting of XmlDateTime more consistent
1 parent 582db81 commit d887c3a

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

pom.xml

-5
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,6 @@
120120
<version>4.0.0</version>
121121
<scope>runtime</scope>
122122
</dependency>
123-
<dependency>
124-
<groupId>com.migesok</groupId>
125-
<artifactId>jaxb-java-time-adapters</artifactId>
126-
<version>${jaxb.java.time.adapters.version}</version>
127-
</dependency>
128123
<dependency>
129124
<groupId>org.glassfish.jaxb</groupId>
130125
<artifactId>jaxb-runtime</artifactId>

src/main/java/org/rutebanken/time/XmlDateTime.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
import java.time.LocalDateTime;
44
import java.time.ZoneId;
55
import java.time.ZonedDateTime;
6+
import java.time.format.DateTimeFormatter;
67
import java.util.Objects;
78

89
/**
9-
* A wrapper type to represent the fact that xml xml dateTime can both include local and zoned
10+
* A wrapper type to represent the fact that the XML dateTime can both include local and zoned
1011
* date times.
1112
*/
1213
public class XmlDateTime {
@@ -43,10 +44,10 @@ public boolean isLocal() {
4344
@Override
4445
public String toString() {
4546
if(zonedDateTime != null) {
46-
return zonedDateTime.toString();
47+
return zonedDateTime.format(DateTimeFormatter.ISO_DATE_TIME);
4748
}
4849
else {
49-
return localDateTime.toString();
50+
return localDateTime.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
5051
}
5152
}
5253
}

0 commit comments

Comments
 (0)