| 1 | | The `time` element is ''technically'' optional. So this shouldn't be too difficult to fix. |
| | 1 | The `time` element is ''technically'' optional. ~~So this shouldn't be too difficult to fix.~~ |
| | 2 | |
| | 3 | EDIT: Nevermind. It looks like it is going to be breaking several public methods to fix this. |
| | 4 | |
| | 5 | This would be the "easiest" fix that closes this ticket. Unfortunately, it also means that older behavior would not work, and converting an arbitrary way to a GPX file would probably fail. |
| | 6 | |
| | 7 | {{{#!diff |
| | 8 | Index: src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java |
| | 9 | =================================================================== |
| | 10 | diff --git a/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java b/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java |
| | 11 | --- a/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java (revision 18597) |
| | 12 | +++ b/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java (date 1668458279450) |
| | 13 | @@ -886,8 +886,6 @@ |
| | 14 | wpt.setTimeInMillis(time); |
| | 15 | } else if ((v = gpxVal(n, gpxPrefix, GpxConstants.PT_TIME)) != null) { |
| | 16 | wpt.setInstant(DateUtils.parseInstant(v)); |
| | 17 | - } else if (!n.isTimestampEmpty()) { |
| | 18 | - wpt.setInstant(n.getInstant()); |
| | 19 | } |
| | 20 | } catch (UncheckedParseException | DateTimeException e) { |
| | 21 | Logging.error(e); |
| | 22 | }}} |
| | 23 | |
| | 24 | In order to really fix this, I'm going to need to extract the OSM to GPX translation code to its own class and add a UI asking the user if they want to keep the node timestamp. |