- Timestamp:
- 2021-04-09T01:24:26+02:00 (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/GpxWriter.java
r16953 r17722 9 9 import java.io.PrintWriter; 10 10 import java.nio.charset.StandardCharsets; 11 import java.time.Instant; 11 12 import java.util.ArrayList; 12 13 import java.util.Collection; … … 170 171 Object val = obj.get(key); 171 172 if (val instanceof Date) { 172 simpleTag(key, DateUtils.fromDate((Date) val)); 173 throw new IllegalStateException(); 174 } else if (val instanceof Instant) { 175 simpleTag(key, String.valueOf(val)); 173 176 } else if (val instanceof Number) { 174 177 simpleTag(key, val.toString()); -
trunk/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java
r17275 r17722 7 7 import java.io.ByteArrayOutputStream; 8 8 import java.io.IOException; 9 import java.time.Instant; 9 10 import java.time.LocalDate; 10 11 import java.time.Month; … … 44 45 GpxData gpx = new GpxData(); 45 46 WayPoint waypoint = new WayPoint(LatLon.ZERO); 47 waypoint.setInstant(Instant.parse("2019-06-08T08:23:12.300Z")); 46 48 consumer.accept(waypoint); 47 49 gpx.addWaypoint(waypoint); … … 89 91 w.put(GpxConstants.PT_PDOP, 1.2); 90 92 }, 93 " <time>2019-06-08T08:23:12.300Z</time>\n" + 91 94 " <sat>16</sat>\n" + 92 95 " <hdop>0.7</hdop>\n" +
Note:
See TracChangeset
for help on using the changeset viewer.